Sublime 3 如何設置xftp 保存自動上傳


采用sublime SFTP插件,直接保存CentOS服務器的NodeJS文件,這樣調試起來很方便,當然得配上

 

一直采用File  ->   SFTP/FTP  ->   Setup Server/Browse Server,  這樣的話一直就把文件保存在c:\users\【用戶名】\appdata\local\temp\sublime-sftp-browse-1465899934\【Centos服務上面的路徑】!

把sublime-sftp-browse-1465899934文件夾拖放到sublime里面,一直采用這樣的方式在操作,也一直相安無事,每次已修改文件,然后Ctrl + S  就自動上傳的服務器,然后......,服務器就自動訪問了!

突然的桌面管理軟件自動清空了垃圾文件,突然發現我的本地代碼文件都木有了!沒辦法只能重新整理一下了,所以在就在桌面創建了nodeserver文件夾,然后把此文件夾拖進sublime,然后進行設置SFTP/FTP,

整個的sftp-config.json的文件如下: 

 

{
    // 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,
    "sync_down_on_open": true,
    "sync_skip_deletes": false,
    "sync_same_age": true,
    "confirm_downloads": false,
    "confirm_sync": false,
    "confirm_overwrite_newer": false,
    
    "host": "www.xxxx.club",
    "user": "root",
    "password": "xxxxxxxxxx",
    //"port": "22",
    
    "remote_path": "/home/testen/nodeserver/",
    //"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,
}

  大部分內容,相信各位看官都情況,我就不多說了

    "save_before_upload": true,
    "upload_on_save": true,
  

  這兩個參數尤為重要,save_before_upload表示在上傳之前進行保存,upload_on_save在保存時進行上傳!

  ok,這樣就達到了目的,在sublime保存后,自動上傳文件,這樣就方便瀏覽了!
   

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM