sublime text3
1.sublime3的下载地址:
http://www.sublimetext.cn/
2.安装插件包
http://packagecontrol.cn/installation
(中国地区的)
第一步:通过控制台安装插件代码,通过 ctrl+` 或 View > Show Console打开控制台,将Python代码粘贴到控制台,回车。
import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.cn/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
3.打开编辑器输入框(Ctrl+Shift+P),并执行 install Package
4.输入:sftp
5.对项目右键鼠标 选择SFTP/FTP,出现配置文件
配置文件如下:
{
// 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": "sftp",
"save_before_upload": true,
"upload_on_save": true, //保存就是上传 改为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": "192.168.1.1", //服务器的IP地址或者域名 每个人的不同
"user": "root",//服务器上的用户名字root/centos/ubuntu每个人的不同
"password": "111111",//服务器密码 每个人的不同
//"port": "22",
"remote_path": "/root/server/",//对应代码的存放位置 每个人的不同
"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,
}
vscode
1.vscode的下载地址:
http://https://code.visualstudio.com/
2.安装插件(Ctrl+Shift+X)
安装:SFTP
3.修改配置文件
{
"name": "My Server",
"host": "172.16.0.121", //服务器位置
"protocol": "sftp",
"port": 22, //服务器端口
"username": "root",//服务器用户名子
"password": "123456",//用户密码
"remotePath": "/home/centos/framework/hall",
"uploadOnSave": true,
"syncMode":"update"
}