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 File ▶ SFTP/FTP ▶ Edit Server menu and selecting a server.
Remote settings are changed by selecting the SFTP/FTP ▶ Edit Remote Mapping… 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 , ftps or sftp . 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 sftp connection with SSH keys.
Default: «» port The port number to connect to. This is only necessary if using a non-standard port for the type specified. When creating an ftps connection, if the port is set to 990 , 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 is cd . . Setting this to 0 disables 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 sftp connection. 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_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
- C
- af_ZA
- am_ET
- ast_ES
- bg_BG
- bn_BD
- bn_IN
- ca_ES
- cs_CZ
- cs_CZ2
- da_DK
- de_AT
- de_CH
- de_DE
- el_GR
- en_AU
- en_CA
- en_GB
- en_NZ
- en_US
- es_AR
- es_CL
- es_CO
- es_CR
- es_DO
- es_EC
- es_ES
- es_GT
- es_HN
- es_MX
- es_NI
- es_PA
- es_PE
- es_PR
- es_SV
- es_UY
- es_VE
- et_EE
- eu_ES
- fa_IR
- fi_FI
- fr_BE
- fr_CA
- fr_CH
- fr_FR
- gl_ES
- he_IL
- hr_HR
- hu_HU
- id_ID
- it_CH
- it_IT
- ja_JP
- km_KH
- ko_KR
- lt_LT
- lv_LV
- mk_MK
- ms_MY
- my_MM
- nb_NO
- nds_DE
- nl_BE
- nl_NL
- nn_NO
- pl_PL
- pt_BR
- pt_PT
- ro_RO
- ru_RU
- si_LK
- sk_SK
- sl_SI
- sq_AL
- sr_RS
- sv_SE
- ta_IN
- th_TH
- uk_UA
- ur_PK
- vi_VN
- zh_CN
- zh_HK
- zh_TW
Remote Only Settings
The following settings are not applicable to the server workflow.
save_before_upload A boolean ( true or false ) 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_regexes pattern 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 true will 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 Preferences ▶ Package Settings ▶ SFTP ▶ Settings – Default . Customized settings should be saved to sibling menu item Settings – User to prevent them from being overridden during an upgrade.
hide_output_panel Controls when the output panel is hidden. true only shows the output panel upon error. false always 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_command is provided, the diff functionality built into Sublime Text will be used. For command line arguments, %1$s will be replaced with the path to the local file and %2$s will 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_command setting is used. If set to false then 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 false and create a request for assistance in compiling a custom _ssl.so for 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 true will log license information and commands being sent back and forth. Setting this to 2 will 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.exe on Windows) program.
Default: «» hg_binary_path The absolute filesystem path to the hg ( hg.exe on Windows) program.
Default: «» svn_binary_path The absolute filesystem path to the svn ( svn.exe on 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_open does 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.
Как я боролся с Sublime Text 2
Привет! Если ты это читаешь, значит знаешь, что такое Sublime Text 2 или слышал о нем хоть, что-то.
Сегодня пойдет речь о том, как я его настраивал и мучал свои мозги. Тут все будет легко, все будет разложено по полочкам, но как я доставал инфу на разных зарубежных форумах, пересматривал все файлы, что бы найти эти настройки — это просто пипец, мягко говоря. Ладно, не буду больше жаловаться, приступим.
И так, я расскажу про то, как я:
1. Боролся с кодировкой при открытии. При открытии фала с кодировкой windows-1251, русские буквы превращались в кракозябры.
2. Установка словаря, для подсветки, если не правильно написал слово.
3. Установка плагина SFTP и подключение к серверу.
1. Давайте разберемся кодировкой
я прочитал уйму информации в интернете как это сделать, пытался делать не получалось, не знаю, то ли версия не та, то ли слоупок, так к чему я веду, изо всей предоставленной информации которую я нашел, я извлек только, то, что нужно что-то, где-то изменить, я вот я полез по всем файлам и искать какие нибудь строчки с напоминанием про кодировку, либо название самой кодировки.
Немного пробежавшись по файлам, я наконец-то нашел, то, что мне нужно и это был файл «Preferences.sublime-settings», он находится в «C:\Users\ваш логин\AppData\Roaming\Sublime Text 2\Packages\Default», открываем его и ищем
я правда не помню какая там была кодировка, но вроде эта, так вот нам строчку:
надо заменить на
Нажимаем сочетания клавиш Ctrl+S, перезагружаем ST2, и радуемся жизни.
2. Установка словарей
Тут я то же все для вас упросил, не надо качать кучу не нужных файлов изменять их, адаптировать и т.д, нужно скачать 2 файла и закинуть их в папку.
Качаем архив — Скачать
Два файла которые там лежат, закидываем в папку %appdata%/Sublime Text 2/Packages/
Теперь нам их надо поставить Вид → Словарь → russian_english (View→ Dictionary → russian_english) и включаем режим проверки орфографии F6
и проверяем
Но есть проблема: словарь не предлагает вариантов для замены, Sublime Text 2 подчеркивает, но варианты исправления не дает.
3. Установка плагина SFTP и подключение к серверу.
Для того, что бы нам установить SFTP, нам понадобится «Sublime Package Control«, давайте для начала установим его.
Открываем консоль сочетанием клавиш ctrl+` во открывшуюся консоль вставляем следующие строчки:
Эта команда создает Installed Packages папку (при необходимости), а затем загружает Package Control.sublime-package в него.
Осталось немного.Запускаем программу.
Идем сюда:
И нажимаем на «Package Control», далее мы видим:
Выбираем Install Packages, у нас появляется окно с поиском, туда вводим «sftp» и выбираем первый запрос
разу начнется загрузка плагина, внизу, вы сможете увидеть, что-то типо этого
ну и потом слова о завершении операции.
Все, установили.
Идем создавать подключение, для этого нам надо создать файл настроек для этого идем(см.карт. ниже)
У нас откроется новая вкладка
1. Тут вместо «fstp» ставим «ftp»
2. Это ваш хост, к которому вы подключаетесь
3. Ваш логин для подключения
4. Если вы подключаетесь «анонимно», то оставляем как есть. Если же вам нужно ввести пароль, то раскомментируем эту строчку и пишем ваш пароль.
5. Порт, если надо, то же раскомментируем.
6. Тут у меня были проблемы с подключением, не буду объяснять, че и как, напишу просто. Вам тут нужно просто выйти на главный каталог, а для этого вместо «/example/path/», пишем «/» и все. Жмем ctrl+s и идем дальше.
Теперь для того, что бы подключиться мы идем сюда(см.картинку ниже)
У вас вылазит такое окошко и вы видите там ваш сервер, нажимаете на него и коннектитесь.
Вот это ваши папки, ну что с ними делать я думаю вы поймете.