Here are some notes and comments on the topic. Additional entries will be added as new points of interest or issues arise that are deemed worth sharing.
Move cursor to beginning of selection
- Install SelectUntil Package
- On Windows, select text and press: alt + shift + r to reverse all selections (so if the insertion point is at the end of the selection, it is moved to the beginning, and vice versa).
Source: https://packagecontrol.io/packages/SelectUntil
Git integration
Learn about file status badges etc.: https://www.sublimetext.com/docs/git_integration.html
Print to HTML not working on Windows
Make sure html files are set to open in a browser (right click file desktop icon > properties).
Add Windows 10 Shortcut: Open With Sublime Text
Create .bat-file of the following code and run as administrator. Or download from Github.
@echo off SET st2Path=C:\Program Files\Sublime Text 3\sublime_text.exe rem add it for all file types @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f rem add it for folders @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f pause
Keyboard Shortcuts
- Open console on German keyboard:
Strg + Ö - Open color picker:
Ctrl + Shift + c - Insert block comment:
Ctrl + # - Close Window:
Ctrl + w - Close Window and Project
Ctrl + Shift + w - Select multiple instances of word:
Alt + F3 - DoubleClick search result:
Shift + F4 - Goto Prev/Next Tab:
Ctrl + Page Up/Down - Move Tab Left/Right:
Ctrl + Shift + Page Up/Down
Search
Add or exclude files and folders from file search results (via „where“-field):
/* Include only PHP, JS and CSS files */
[Folder_to_Search], *.php,*.js,*.css
/* Exclude JSON files */
[Folder_to_Search], -*.json
/* Exclude Font Awesome folder */
[Folder_to_Search], -*/font-awesome/*
/* Exclude all CSS files in a specific path or folder */
[Folder_to_Search], -*/font-awesome/*.css
/* Exclude all files from specific path */
[Folder_to_Search], -*/bootstrap-icons/*
Configuration File (sftp-config.json)
ignore_regexes
Ignore a specific file
"/file_name\\.ext"
Ignore a complete folder
"/folder_name/"
Ignore files with a specific extension
"\\.ext"
Igore everything in folder including subfolders
"_dev/*", "exports/*"
Syntax Specific Color Schemes
Open document of specific type, then go to Preferences -> Settings – More -> Syntax Specific – User.
then add
{
„color_scheme“: „Packages/Color Scheme – Default/Sunburst.tmTheme“,
}
Installed Packages
Get list of installed packages (with Package Control installed): Preferences -> Package Settings -> Package Control -> Preferences - User
.
Package Modifications
Copy modified package file into user folder. You can prefix the file name with the package name for clearity (e.g. „DocBlockr-jsdocs.py“).
Syncing Sublime Text Settings Across Machines
Use Git to sync sublime packages and settings across multiple Windows machines:
- On the first machine create a Git repository in: C:\Users\stefa\AppData\Roaming\Sublime Text 3\Packages\User
- Symc the repository to the remote git server.
- Install your packages, add settings etc.
- On other machines clone the remote git repository to: C:\Users\stefa\AppData\Roaming\Sublime Text 3\Packages\User
- Install package control. It will then automatically install all sublime packages according to the synced package control settings.
Add Sublime Text to Windows Context Menu
Create a reg file subl.reg and open it with a text editor and add the content:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Edit with Sublime Text]
@="Edit with &Sublime Text"
"Icon"="C:\\Program Files\\Sublime Text 3\\sublime_text.exe,0"
"MuiVerb"="Edit with Sublime Text"
[HKEY_CLASSES_ROOT\*\shell\Edit with Sublime Text\command]
@="C:\\Program Files\\Sublime Text 3\\sublime_text.exe \"%1\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\Sublime]
@="Open with Sublime Text"
"Icon"="C:\\Program Files\\Sublime Text 3\\sublime_text.exe,0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\Sublime\command]
@="\"C:\\Program Files\\Sublime Text 3\\sublime_text.exe\" \"%V\""
[HKEY_CLASSES_ROOT\Directory\shell\Sublime]
@="Open with Sublime Text"
"Icon"="C:\\Program Files\\Sublime Text 3\\sublime_text.exe,0"
[HKEY_CLASSES_ROOT\Directory\shell\Sublime\command]
@="\"C:\\Program Files\\Sublime Text 3\\sublime_text.exe\" \"%1\""
Double click the file to run it. Source: https://stackoverflow.com/questions/39839764/sublime-text-3-how-to-add-to-right-click#:~:text=You%20can%20click%20a%20checkbox,menu%20when%20installing%20Sublime%20Text.&text=You%20may%20need%20to%20adapt,and%20rightclick%20on%20a%20folder.
Troubleshooting
** Sublime SFTP: When syncing a folder with multiple subfolders, the error log file opens containing the following message: „Invalid SSH key passphrase specified“.
Removing and reinstalling the Sublime SFTP package only resolves the issue until Sublime Text gets closed and reopened.
To get rid of the error popup without turning off other error popups, comment out and replace the following line inside SFTP.py in the package root folder (around line 300):
# if message.find('/sftp/') != -1 or message.find('\\sftp\\') != -1:
if message.find('Invalid SSH key passphrase specified') == -1 and (message.find('/sftp/') != -1 or message.find('\\sftp\\') != -1):
In Case you want to prevent all Sublime SFTP error popups, just comment out the following lines inside SFTP.py:
if sftp_debug.get_debug() and sftp_debug.get_debug_log_file(): send_log_path = sftp_debug.get_debug_log_file() sftp_debug.debug_print(message) sublime.error_message( 'Sublime SFTP\n\nAn unexpected error occurred, please send ' 'the file %s to support@wbond.net' % send_log_path ) sublime.active_window().run_command( 'open_file', {'file': sftp_paths.fix_windows_path(send_log_path)} )
For upgrade safety: Copy SFTP.py to user root folder for modifications. It will override the package file. Keep in mind, that package updates could also contain updates to the file.
** Git diff badges not showing: Only fully works with 64bit version of Sublime Text. Try adding to preferences:
"git_diff_target": "head"
** Autosave feature can’t be turned of: Look for setting „save_on_focus_lost“ not only in general preferences but also project related preferences.