sublime有個叫sftp的插件,可以通過它直接打開遠程機器上的文件進行編輯,並在保存后直接同步到遠程linux服務器上。
用Package Control安裝插件
按下Ctrl+Shift+P調出命令面板
輸入install 調出 Install Package 選項並回車,然后輸入FTP,下拉列表中會出現一些相關的插件,
選中SFTP進行安裝就行了,裝好后還需配置如下:選菜單欄中的File->SFTP/FTP->Setup Server,然后
出現一個配置窗口如下:
{ // 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", "sync_down_on_open": true, "sync_same_age": true, "host": "example.com", "user": "username", //"password": "password", //"port": "22", "remote_path": "/example/path/", //"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, }
配置好信息,就出來鏈接信息
然后可以進行編輯修改
C:\users\asus\appdata\local\temp\sublime-sftp-browse-1588165986\56ftp\新建文本文檔.txt
第二種方法
新建一個文件夾
然后有個配置信息
一般都可以了,緊接着就是新建一個目錄,名字要和服務器中的一樣,這個才能讓插件找到位置,在這個目錄下點擊右鍵
Linux服務器上就有文件了
type:是ftp還是sftp,自己填,這里填了port就會自動配的
host:就是ftp/sftp的服務器地址了
user:用戶名
password:密碼
port:type配了ftp默認是21,配了sftp默認是22,如果你端口特殊,那么就需要配置
remote_path:鏈接后默認打開的遠程目錄
菜單翻譯

如果提示FTP要購買
{ "email": "xiaosong@xiaosong.me", "product_key": "d419f6-de89e9-0aae59-2acea1-07f92a" }