因为开发 skynet 的需要,又不想在Linux环境下写代码,且centos又是装在虚拟机中,所以就搜到这个神器-SFTP,可以用SSH通道同步远程服务器的文件,一般服务器应用开发的流程是在本地编辑器写好代码,上传到服务器,编译调试,然后继续这样的循环。我先前一直是scp过去的,比较麻烦,SFTP则可以让你直接在sublime text中就上传文件到服务器。安装好后,在要同步的文件那里右键”SFTP/FTP->Map To Remote…”,配置好服务器地址账户密码还有要映射过去的文件夹位置,就可以同步文件,文件夹,还可以监控某个文件,在本地修改后就自动同步到服务器。
1、新建文件夹
Skynet
映射远端 文件夹
2、用sublime新建一个窗口,把文件夹拖进去,再显示出左栏窗口
ctrl + k , ctrl + b
3、配置同步信息
4、下载远端所有文件
5、done
6、修改文件后直接同步到远端
ctrl + alt u , ctrl + alt + y
配上快捷键更好用:
[
{ "keys": ["ctrl+alt+u","ctrl+alt+f"], "command": "sftp_upload_file" },
{ "keys": ["ctrl+alt+u","ctrl+alt+r"], "command": "sftp_upload_folder" },
{ "keys": ["ctrl+alt+u","ctrl+alt+y"], "command": "sftp_sync_up" }, //本地同步到远端
{ "keys": ["ctrl+alt+u","ctrl+alt+n"], "command": "sftp_upload_open_files" },
{ "keys": ["ctrl+alt+u","ctrl+alt+m"], "command": "sftp_monitor_file" },
{ "keys": ["ctrl+alt+u","ctrl+alt+o"], "command": "sftp_download_file" },
{ "keys": ["ctrl+alt+u","ctrl+alt+e"], "command": "sftp_download_folder" },
{ "keys": ["ctrl+alt+u","ctrl+alt+d"], "command": "sftp_sync_down" }, //远端同步到本地
{ "keys": ["ctrl+alt+u","ctrl+alt+i"], "command": "sftp_diff_remote_file" },
{ "keys": ["ctrl+alt+u","ctrl+alt+b"], "command": "sftp_sync_both" },
{ "keys": ["ctrl+alt+u","ctrl+alt+c"], "command": "sftp_vcs_changed_files" },
{ "keys": ["ctrl+alt+u","ctrl+alt+w"], "command": "sftp_browse" },
{ "keys": ["ctrl+alt+r","ctrl+alt+s"], "command": "sftp_create_server" },
{ "keys": ["ctrl+alt+r","ctrl+alt+b"], "command": "sftp_browse_server" },
{ "keys": ["ctrl+alt+r","ctrl+alt+n"], "command": "sftp_last_server" },
{ "keys": ["ctrl+alt+r","ctrl+alt+e"], "command": "sftp_edit_server" },
{ "keys": ["ctrl+alt+r","ctrl+alt+d"], "command": "sftp_delete_server" },
{ "keys": ["ctrl+alt+u","ctrl+alt+s"], "command": "sftp_show_panel" },
{ "keys": ["ctrl+alt+u","ctrl+alt+x"], "command": "sftp_cancel_upload" }
]
a