我使用 Sublime text SFTP 在我的远程服务器上工作,当我按下 Ctrl-S 时,它会自动上传到远程服务器。但是,在我的 EC2 服务器上,Ctrl-S 仅保存本地临时文件,我需要使用上下文菜单 SFTP > 上传文件来保存。
任何选项可以在 ctrl-s 上启用远程保存?
这是我使用的 config.json :
"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,
我尝试了以下方法:
“save_before_upload”:真,
“upload_on_save”:真,
sftp_flags 而不是 ssh_key_file
但到目前为止没有任何效果
最佳答案
希望这对你有帮助,它对我有用。
{
"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>"]
}
见:https://stackoverflow.com/a/17310355/1858217
关于amazon-ec2 - EC2 上的 Sublime 文本 SFTP,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22580345/