一个编辑器如果自带一个ftp插件,那么势必能提高效率,不用去其他的ftp软件寻找文件,和上传文件。

在Sublime Text中安装ftp也是一个比较简单的事情。

首先要安装好Package Control插件,这篇文章有插件的安装。

第二步:进入到Package Control : Install Package插件界面后,输入ftpsync,选择FTPSync插件,点击确定,然后等待下载安装。

第三步:需要设置一下Project,如果没有将文件夹设置为Project,需要在工具栏中点击Project - Add Folder to Project...,选择文件夹。

第四步:这样左侧会出现project文件夹,右键project,选择FTPSync - Setup FTPSync in this folder,之后会出来一个配置文件ftpsync.setting,对配置文件进行修改。

第五步:主要修改host、username、password、path、upload_on_save。

注意一点,最后一个可用的属性,不能以,(逗号)结尾,不然会认为你后面还有其他选项,导致配置文件格式不对。比如50行,false后面没有,(逗号)

第六步:在project目录结构中选择文件右键上传,或者在命令输入框中输入命令。

附:

{

    // ------ INFO ----------------------------------------------------------------------

    // ** Commas

    // don't forget about commas
    // -> each entry needs a comma at the end of line EXCEPT the last (uncommented) entry
    // for precise info see www.json.org

    // ** Comments

    // the "//" are so called "comments", all text after it is ignored
    // they are used for notes or deactivating an entry

    // non-basic settings are deactivated and default options specified in the global settings file,
    // that is $packages$/FTPSync/ftpsync.sublime-settings (where $packages$ is a path where Sublime
    // keeps packages in your Operating System) accessible via Preferences > Package Settings > FTPSync
    // use Settings - User to override the global defaults

    // more info about Sublime Text 2 settings on http://www.sublimetext.com/docs/2/settings.html

    // -> if you want to activate a settings entry with preceding //, remove the //

    // ------ SETTINGS ------------------------------------------------------------------

    // your main connection
    "default": {

        // address
        "host": "www.chenyudong.com",

        //"port": 21,

        // credentials
        "username": "",  // or null for anonymous login
        "password": "",

        // server path to your project (example: /www/)
        // start with "/" and then append all the folders you'd need to open to get to your project from topmost folder
        "path": "/",

        // true = secured FTP connection
        //"tls": false,

        // set whether the connection will be passive or active
        //"passive": true,

        // true = upload on save, false = upload only manually
        "upload_on_save": false

        // how long until connection closes [seconds]
        //"timeout": 30,

        // regular expression, when matches the file path of the file-to-be-uploaded, it cancels its upload
        //"ignore": "",

        // whether to check 'last updated' of the target file on server
        //"overwrite_newer_prevention": true,

        // if set to true it will download the file from server on opening, but only if it's newer than the current file
        //"download_on_open": false,

        // delay [seconds] before changed file is uploaded !when using upload_on_save!
        // can be used for increase of performance or to allow build scripts to finish
        //"upload_delay": 0,

        // If the server you're working with is in a different timezone, you can specify the offset here
        // in seconds.  For example, if the FTP server is 1 hour ahead of you, use -3600 as the offset to
        // make comparisons against the server time take 3600 seconds off of the server time.
        //"time_offset": 0,

        // chmod value for directories created on remote server by FTPSync
        //"default_folder_permissions": "755",

        // list of lists with pathnames and filenames to folders to be watched for change in between delay (upload_delay)
        //
        // ** example:
        //    after_save_watch: [ [ "code/assets/css", "*.css" ], [ "code/assets/", "*.jpg, *.png, *.gif" ] ]
        //
        // ** Used only in conjunction with upload_on_save and upload_delay **
        //
        //"after_save_watch": []

    }
}

声明:未经允许禁止转载 东东东 陈煜东的博客 文章,谢谢。如经授权,转载请注明: 转载自东东东 陈煜东的博客

本文链接地址: sublime text 2安装ftp插件 – https://www.chenyudong.com/archives/sublime-text-install-ftp-plugin.html