SFTP for Sublime Text
Settings
Most settings are configured per-remote/server, however some remote only and others are configured on the plugin level.
The default remote and server config file is located at Packages/SFTP/SFTP.default-config. This can be customized by copying the file into Packages/Users/ and editing. Just be sure to compare it with the one in Packages/SFTP/ when new versions of SFTP are released.
Remote/Server Settings
Server settings are changed by going to the menu and selecting a server.
Remote settings are changed by selecting the menu when right clicking on a folder in the side bar, or editing the sftp-config.json file in your folder.
Tip: use the tab key to cycle through settings when first creating a config.
- type
- If the connection should use
ftp,ftpsorsftp. Changing this also automatically changes the port, if it is not specified.
Default:"sftp" - host
- The domain name or IP address to connect to.
Default:"example.com" - user
- The username to use when connecting to the
host.
Default:"username" - password
- The password to use. This is not necessary if using an
sftpconnection with SSH keys.
Default:"" - port
- The port number to connect to. This is only necessary if using a non-standard port for the
typespecified. When creating anftpsconnection, if the port is set to990, an implicit SSL connection will be made, as opposed to the server and client negotiating the security.
Default:"" - remote_path
- For the Remote workflow, the absolute path on the remote to map the current folder to. For the Server workflow, the default folder to display.
Default:"/example/path/" - file_permissions
- The octal permissions to chmod files to. This should not start with a
0.
Default:"" - dir_permissions
- The octal permissions to chmod folders to. This should not start with a
0.
Default:"" - extra_list_connections
- The number of additional connections to create to the server when performing the list commands that are used to determine what operations should be performed during a sync. Adding extra connections can drastically improve the performance of sync for large folder trees.
Default:0 - connect_timeout
- The number of seconds to timeout after when trying to connect.
Default:30 - keepalive
- The number of seconds between sending a dummy command to the server to keep the connection open. For FTP connections, the command is
NOOP, for SFTP connections, the command iscd .. Setting this to0disables keepalive commands.
Default:0 - ftp_passive_mode
- If pasv mode should be used for the FTP connection. If the first upload to an FTP server takes a long time, try setting this to false. While this is not set explicitly by default in the plugin, the Python ftp library defaults to using passive mode.
Default:"" - ssh_key_file
- The SSH private key file to use for an
sftpconnection. Linux and Mac will use the private key in ~/.ssh/ by default. On Windows this should be a .ppk file generated via Pageant.
Default:"" - sftp_sudo
- If the
sftp-serverexecutable should be invoked on the server via sudo. This requires password-less sudo on the server being connected to, and requires the server be running Unix.
Default:false - sftp_debug
- Sends the
-vflag to the sftp binary when on Linux or Mac, or the psftp.exe binary when on Windows. Causes extra debug information to be displayed in the Sublime Text console.
Default:false - sftp_flags
- Raw command line flags to send to the sftp binary when on Linux or Mac, or the psftp.exe binary when on Windows. Each flag should be a separate entry in the list.
Default:[] - preserve_modification_times
- If the modification times of files should be preserved when uploading and downloading. This setting may be
false,true(for uploads and downloads) and"download_only"."download_only"may be required since this functionality is not available on all FTP servers.
Default:false - remote_time_offset_in_hours
- The number of hours difference between the local machine and remote/server. This is normally determined automatically when connecting and should not normally need to be set.
Default:0 - remote_encoding
- The remote encoding to use for unicode file paths. Normally this only needs to be adjusted for Windows FTP servers if using unicode file paths. See the python documentation for a valid list of encodings.
Default:"utf-8" - remote_locale
- This settings is used to parse the last modified timestamps on remote files. Normally this should not need to be adjusted. Show valid locales
Default:Valid LocalesCaf_ZAam_ETast_ESbg_BGbn_BDbn_INca_EScs_CZcs_CZ2da_DKde_ATde_CHde_DEel_GRen_AUen_CAen_GBen_NZen_USes_ARes_CLes_COes_CRes_DOes_ECes_ESes_GTes_HN
es_MXes_NIes_PAes_PEes_PRes_SVes_UYes_VEet_EEeu_ESfa_IRfi_FIfr_BEfr_CAfr_CHfr_FRgl_EShe_ILhr_HRhu_HUid_IDit_CHit_ITja_JPkm_KHko_KRlt_LTlv_LV
mk_MKms_MYmy_MMnb_NOnds_DEnl_BEnl_NLnn_NOpl_PLpt_BRpt_PTro_ROru_RUsi_LKsk_SKsl_SIsq_ALsr_RSsv_SEta_INth_THuk_UAur_PKvi_VNzh_CNzh_HKzh_TW
"C"
Remote Only Settings
The following settings are not applicable to the server workflow.
- save_before_upload
- A boolean (
trueorfalse) setting that controls whether or not files will be saved before uploading. This only affects files uploaded via the keyboard command.
Default:true - upload_on_save
- If files should be automatically uploaded when saved. Files that match the
ignore_regexespattern are not automatically uploaded.
Default:false - sync_same_age
- If files that are approximately the same age should be transfered when syncing. The FTP and SFTP protocols do not report modification time beyond the granularity of the minute, meaning that files that are the "same age" may, in fact, be different.
Default:true - sync_down_on_open
- When a file is opened, the remote file modification time will be checked. If it is newer, the user will be prompted if they wish to download it.
Default:false - sync_skip_deletes
- When performing Sync Up and Sync Down command, skip looking for files to delete.
Default:false - confirm_downloads
- If a yes/no confirmation should be presented to the user when downloading a file or folder.
Default:false - confirm_sync
- If a yes/no confirmation should be presented to the user when performing sync commands.
Default:true - confirm_overwrite_newer
- If the user should be presented with a yes/no confirmation when uploading a file with a modification time that is older than the version of the file on the server. This only works when uploading individual files. Please note that setting this to
truewill have a slight affect on performance since a remote file listing will need to be performed on each file upload.
Default:false - ignore_regexes
- A list of regular expressions to compare with file and folder paths to see if they should be ignored. The complete path to the file or folder will be compared to this regular expression. This uses the Python re module, and regular expression must be compatible with that. A literal backslash requires four backslashes since both JSON and regular expressions require backslashes to be escaped.
Default:["\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json", "sftp-settings\\.json", "/venv/", "\\.svn", "\\.hg", "\\.git", "\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"]
Plugin Settings
There are a handful of settings available for SFTP, and they can be changed by selecting the menu item . Customized settings should be saved to sibling menu item to prevent them from being overridden during an upgrade.
- hide_output_panel
- Controls when the output panel is hidden.
trueonly shows the output panel upon error.falsealways shows the output panel and never hides it. (number) shows the output panel and hides it after (number) seconds.
Default:1 - diff_command
- A list containing the path to an external diff program, combined with the the necessary command line arguments. If no
diff_commandis provided, the diff functionality built into Sublime Text will be used. For command line arguments,%1$swill be replaced with the path to the local file and%2$swill be replaced with the path to the temp file representing the remote file.
Default:[] - delete_temp_diff_folder
- If the temporary folder created for perfoming remote diff operations should be deleted when the diff is complete. This only affects functionality when the
diff_commandsetting is used. If set tofalsethen the user is responsible for removing temp folders.
Default:true - monitoring_frequency
- The number of milliseconds (1000 per second) between each file stat when using the Monitor File command. This should only need to be tweaked if experiencing disk performance issues.
Default:200 - linux_enable_ssl
- Enable experimental ssl module for Linux users. This is required for FTPS support. Sublime must be restarted after changing this. If Sublime becomes unstable after enabling this, please set it back to
falseand create a request for assistance in compiling a custom_ssl.sofor your distribution.
Default:false - debug
- Adds debugging output to the Sublime Text console. This can be useful when experiencing trouble connecting to a server. Setting this to
truewill log license information and commands being sent back and forth. Setting this to2will add debugging about internal operations that is useful for bug reports.
Default:false - debug_log_file
- A file to save debug messages to, instead of printing them to the console.
Default:"" - git_binary_path
- The absolute filesystem path to the
git(git.exeon Windows) program.
Default:"" - hg_binary_path
- The absolute filesystem path to the
hg(hg.exeon Windows) program.
Default:"" - svn_binary_path
- The absolute filesystem path to the
svn(svn.exeon Windows) program.
Default:"" - osx_sync_down_on_open_delay
- A setting used to tweak how many milliseconds to wait on Mac before checking to see if a file load event was triggered for fully loading the file (with a tab). Sublime Text on Mac seems to suffer from a delay before the tab is opened (at least according to the API), so this setting can help users fix issues if
sync_down_on_opendoes not alway seem to work.
Default:500
All three binary path settings will normally will be auto-detected and only need to be set if an error indicates such.