I use Sublime text SFTP to work on my remote servers, and when I hit Ctrl-S, it uploads automatically to the remote. However, on my EC2 server, Ctrl-S only saves the local temp file, and I need to use the context menu SFTP > Upload File to save.
Any options to enable the remote save on ctrl-s?
Here's the config.json I use :
"type": "sftp",
"sync_down_on_open": true,
"sync_same_age": true,
"host": "xxx.amazonaws.com",
"user": "xxx",
"remote_path": "/var/www",
"connect_timeout": 30,
"ftp_passive_mode": true,
"ssh_key_file": "D:\\xxx.ppk",
"remote_time_offset_in_hours": 1,
I tried the following :
"save_before_upload": true,
"upload_on_save": true,
sftp_flags instead of ssh_key_file
but nothing has worked so far
Hope this helps you, it worked for me.
{
"type": "sftp",
"sync_down_on_open": true,
"host": "<your ec2 instance hostname>",
"user": "<your username>",
"remote_path": "<your remote path>",
"connect_timeout": 30,
"sftp_flags": ["-o IdentityFile=~<path to .pem file>"]
}
See: https://stackoverflow.com/a/17310355/1858217
Use sftp_flags as following, it should work.
"sftp_flags": ["-i", "/Users/username/pemfile.pem"],
In windows you should use this syntax.
"ssh_key_file": "/Users/Diego/Documents/SSH/Key.ppk",
Related
Do you read the FAQ?
Yes.
Describe the bug:
Live sass compiler with https://github.com/ritwickdey/vscode-live-sass-compiler make style.css.min file but this file do not auto upload
in sftp.json (accesses are hide, only one file do not upload after save):
{
"name": "name",
"host": "host",
"protocol": "ftp",
"port": 21,
"username": "username",
"password": "password",
"remotePath": "/remotePath/",
"uploadOnSave": true,
"watcher": {
"files": "/style.min.css",
"autoUpload": true
}
}
What i need to do to make auto upload generation file style.min.css?
I've installed ftp-simple on vs-code (I can connect with FileZilla) and
I pressed F1, typed config:
[
{
"name": "dev-server",
"host": "192.168.0.140",
"port": 21,
"type": "ftp",
"username": "user",
"password": "12345",
"path": "/var/www/WebApp",
"autosave": true,
"confirm": true
}
]
Pressed F1 again, remote directory open to workspace..and nothing happens.
I've noticed it does take quite a while, you have to be patient, it will load the remote structure eventually. Once loaded, then save as a Workspace.
I am a beginner with sublime text 3. Previous I worked with dream viewer. When I was working with dream viewer, Generally I do keep my project folder in D drive and add new local server in htdoc folder using dream viewer add site option.
Now I need to use sublime text 3 as same I did with dream viewer. I setup a new server using FTP plugin as below
// sftp, ftp or ftps
"type": "ftp",
"sync_down_on_open": true,
"sync_same_age": true,
"host": "127.0.0.1",
"user": "root",
"password": "ashan",
//"port": "22",
"remote_path": "/xampp/htdocs/sanka_d/",
My remote connection as below (sftp-config.jason)
"type": "ftp",
"save_before_upload": true,
"upload_on_save": true,
"sync_down_on_open": false,
"sync_skip_deletes": false,
"sync_same_age": true,
"confirm_downloads": false,
"confirm_sync": true,
"confirm_overwrite_newer": false,
"host": "127.0.0.1",
"user": "root",
"password": "ashan",
//"port": "22",
"remote_path": "/",
When I try to connect with remote server it says below error message.
Connecting to FTP server "127.0.0.1" as "root" ........ failure (Disconnected)
Please help me solve this, Thanks!
Context:
I am working on a React.js app that uses Webpack, and I'm using VS Code as my editor.
The Webpack config is specifying inline-source-map as its devtool option. but I am using hot reloading, too. So, source maps actually come into the browser via this webpack:// protocol.
I am using the following launch.json config:
{
"name": "Launch in Chrome",
"type": "chrome",
"request": "launch",
"url" : "https://myapp.local/", // This is not the real app URL
"trace" : true,
"sourceMaps": true,
"webRoot": "${workspaceRoot}/build",
"sourceMapPathOverrides": {
"webpack:///*" : "${webRoot}/*"
},
"preLaunchTask" : "development",
"internalConsoleOptions": "openOnSessionStart",
"smartStep": true,
"skipFiles": [
"node_modules/**",
"extensions:"
]
}
and I'm using this tasks.json.
Problem
So this mostly works well, except when I put a breakpoint somewhere, it opens the tab in a new tab marked as read-only inlined content from source map:
I just want to be able to debug and work on my files directly!
This is because VC can't find the sources on the file system, so it resorts to using the copy it got from the web server.
This is typical in projects that span both server and client side code, and as a result, the web (HTML/JS/CSS) root is nested inside the workspace root. It can be easily fixed:
in VC, open the root folder of your project. go to "File -> Save workspace as" and save the workspace. Going forward always use the workspace (rather than folder) to enter your project.
In launch.json, set the webRoot value to reflect the relative path of the webRoot (typically folder with index.html). If your webRoot is under "UI", then it should look like this:
"webRoot": "${workspaceFolder}/UI"
I got it working with this launch.json config. Hopefully it helps you.
{
"name": "Launch localhost",
"type": "chrome",
"request": "attach",
"url": "http://localhost:8080",
"port": 9222,
"webRoot": "${workspaceFolder}/src",
"sourceMapPathOverrides": { "webpack:///./src/*": "${workspaceFolder}/src/*" },
"sourceMaps": true,
}
I was running into the same issue remote debugging Python, thanks the two above answers I was able to solve it.
as SimbalCoder suggested I saved the workspace. I suppose this is needed to set your workspace folder path.
I then modified my launch.json as such:
{
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}/Scripts/MyScripts/"
}
],
}
Now the pathMappings are pointing to the correct file and upon debugger entry it is opening the correct file.
I am trying to connect to my cpanel server using sublime text 3.
Server is added successfully. And remote path is also validated successfully.
But when try to Sync Remote->Local it is just not happening.
{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help
// sftp, ftp or ftps
"type": "ftp",
"save_before_upload": true,
"upload_on_save": true,
"sync_down_on_open": false,
"sync_skip_deletes": false,
"sync_same_age": true,
"confirm_downloads": false,
"confirm_sync": true,
"confirm_overwrite_newer": false,
"host": "XXXXXX",
"user": "XXXXX",
"password": "XXXXXXX",
"port": "21",
"remote_path": "XXXXXX",
"ignore_regexes": [
"\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
"sftp-settings\\.json", "/venv/", "\\.svn/", "\\.hg/", "\\.git/",
"\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
],
//"file_permissions": "664",
//"dir_permissions": "775",
//"extra_list_connections": 0,
"connect_timeout": 30,
//"keepalive": 120,
//"ftp_passive_mode": true,
//"ftp_obey_passive_host": false,
//"ssh_key_file": "~/.ssh/id_rsa",
//"sftp_flags": ["-F", "/path/to/ssh_config"],
//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
//"allow_config_upload": false,
}
And in the console I finally got this:
"Select via quick panel? No".
And the process got terminated by itself.
SFTP has some options for that to put on your sftp-config.json file at the root of your folder :
Set those values like this:
"confirm_downloads":false,
"confirm_sync":false,
"confirm_overwrite_newer":true