sublime text 的SFTP插件

其实一直把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" }
]


SFTP 插件配置说明

可以参考这里: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,
}





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值