其实一直把sublime text当成记事本用...
现在还不习惯用Linux环境,正常情况下我是在windows环境下使用Xshell直连后操作的,
在linux下编辑文件实在费劲,于是给Sublime Text装上SFTP插件,然后同步编辑文件
使用插件管理器安装,Perferences->package settings如果存在,说明安装了Package Control,如果没有安装,使用下面的代码安装:
Ctrl+`调出Console
ST3:
import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())
ST2:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read());
重启Sublime Text后 ,
Ctrl+Shift+P调出命令面板,输入install,选择Install Package,获取插件列表后,输入sftp,然后安装就可以了。
SFTP怎么使用可以参考这里http://wbond.net/sublime_packages/sftp/usage
下面是绑定key,快捷键,在Package Settings > SFTP >Key Bindings – Default 可以修改
[
{ "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" }
]
可以参考这里:http://wbond.net/sublime_packages/sftp/settings
在STFP/FTP > Setup Server
其中有些参数是默认配置模板中没提供说明,不建议在生产环境下用
{
//上传前存档
"save_before_upload": true,
//本地保存时同步保存到远程
"upload_on_save": false,
//打开文件时,与远程同步
"sync_down_on_open": false,
//同步时,跳过已经删除的文件
"sync_skip_deletes": false,
//下载确认
"confirm_downloads": false,
//同步确认
"confirm_sync": true,
//复写确认
"confirm_overwrite_newer": false,
}