Install Package Control for easy package management.
- Open the console with
Ctrl+`
- Paste in the following:
import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())
From here on out, use Package Control to install everything. ⌘
+Shift
+P
, then type Install
to get a list of installable packages you can livesearch through. Watch the Status Bar for installation progress.
All installed with Package Manager. ⌘
+Shift
+P
and type install
. Then start typing the name of the extension you want to install.
- SideBarEnhancements Provides enhancements to the operations on Sidebar of Files and Folders.
- SublimeCodeIntel - Full-featured code intelligence and smart autocomplete engine.
- DocBlockr - Simplifies writing DocBlock comments in Javascript, PHP, CoffeeScript, Actionscript, C & C++.
- Emmet - (Formerly Zen Coding) For lightning fast coding.
- SublimeLinter - Code linting & hinting for HTML/CSS/JS.
- HTMLPrettify - HTML/CSS/JS/JSON code formatter via node.js
Accessible via: SublimeText
→ Preferences
→ Settings – User
, or with ⌘
+`,'.'
This is a JSON file of custom user configuration settings. Kept in alphabetical order for easy reference.
Note: As a JSON file no comments can be included. Any you add will be stripped out on saving.
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_complete_with_fields": true,
"bold_folder_labels": false,
"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"default_encoding": "UTF-8",
"detect_indentation": true,
"folder_exclude_patterns":
[
".git",
".bundle",
".sass-cahe"
],
"font_face": "Menlo",
"font_options":
[
"subpixel_antialias"
],
"font_size": 12.0,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
],
"vintage_start_in_command_mode": true,
"line_padding_bottom": 1,
"line_padding_top": 1,
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"word_wrap": true
}
A complete list of Settings can be referenced in SublimeText
→ Preferences
→ Settings – Default
.
Override any which aren't to your taste.
Accessible via: SublimeText
→ Preferences
→ Key Bindings – User
.
Key bindings are the productivity engine which allow you to become one with your text editor. I try to stick with all the defaults to make for an easy install and less chance of potential future clashes. The following are a few small edits I make along with some package specific controls:
[
// Reveal the currently open file in the sidebar
{ "keys": ["ctrl+super+r"], "command": "reveal_in_side_bar" },
// Create a new snippet
{ "keys": ["alt+super+n"], "command": "new_snippet" },
// [HTMLPrettify] Format your HTML, CSS, and JS
{ "keys": ["super+shift+h"], "command": "htmlprettify" },
// Close tag
{ "keys": ["super+."], "command": "close_tag" },
// Alignment
{ "keys": ["super+shift+a"], "command": "alignment" },
// Wrap selection in tag
{
"keys" : ["alt+shift+t"],
"command" : "insert_snippet",
"args": {
"contents": "<${1:p}>${0:$SELECTION}</${1}>"
}
},
]
More info on Key Bindings can be found in the unofficial docs.
Sublime Text includes a command line tool which you just need to symlink up so that it's in your PATH file. In Sublime Text 3 simply copy this into a terminal session:
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
Then you can open files in Sublime Text from the command line with:
subl my_file.txt
Replacing my_file.text
with the name of the file or folder you wish to open in Sublime Text.
Commit these keyboard shortcuts to muscle memory; you'll amaze friends/colleagues w/editor wizardry. Pracice your skills with ShortcutFoo. The CheatSheet app will help while you're learning.
git config --global core.editor "subl -n -w"