This page documents my very scandalous love affair with Sublime Text 2.
Cross-platform Installation & Settings
Download the installer here.
Ubuntu (with PPA Repository) #
1 2 3
Dropbox & Symbolic Links #
Basically, you replace the settings folders in the relevant
.config folders with symbolic links to duplicates you’ve placed in your Dropbox. This allows your packages and settings to persist across machines.
1 2 3
1 2 3
1 2 3
Symbiotic Ubuntu Packages
These are the other development tools I use in conjunction with Sublime Text 2, and which I have tailored my selection of Sublime Text plugins to.
Workflow & Project Settings #
This is a reference to all the vanilla Sublime Text 2 hotkeys that I use all the time.
`– Python console pane (Sublime Text virtualenv)
P– Command palette
P– Switch Project
P– Go To Anything (navigates between files)
G– Go To Line
F11– Distraction Free Mode (Fullscreen)
F6– Spell check
/– Toggle comment on selected line(s)
[– Fold selected text or fold block outside cursor
]– Unfold selected block
#– Fold code where block-level is equal to #
J– Unfold all
L– Select line
D– Select word, select multiple occurrences of selected word
M– Select all within brackets
J– Select all within block
Space– Select next higher scope
Custom ST2 Hotkeys
And this is a recent copy of my custom Key Settings file. This file can be selected from the Preferences menu.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
I didn’t like having to hit
# in sequence in order to fold code, so I removed the first key combination. And
J also unfolds everything.
ST2 Plugins & Their Hotkeys
Package Manager #
This is a must-have and should be installed before proceeding. Most packages listed below can be installed using the ST2 command palette after installing Package Manager.
Buffer Scroll is a simple Sublime Text plug-in which remembers and restores the scroll, cursor positions, also the selections, marks, bookmarks, foldings, selected syntax and optionally the color scheme.
This plugin is a great enhancement to ST2 and doesn’t require any commands to invoke anything. It just recalls your previous session each time you re-open ST2.
V(Windows & Linux) – View clipboard history
V(OS X) – View clipboard history
This Git plugin provides access to many
git commands via the ST2 control pallet (
P). A full list of what is supported can be viewed in the plugin’s wiki.
I personally do not use the plugin to handle commits (I prefer
bash), but the
log features are excellent.
This plugin merely shows the dimensions for image files in the status bar. No commands.
sudo apt-get install imagemagick.
K– KeyMap Manager
oc– insert image
obq– insert blockquote
oc– insert code block
This adds Sass syntax highlighting. You may need to navigate to navigate the menu to
Open all with current extension as... >
Sass in order for it to start working for your particular file extension.
This plugin adds a lot of neat commands to the right-click context menu upon clicking items in the side pane.
Side Bar Git
This plugin adds a Git context menu to the right-click menu on the side pane.
tab code folding to Markdown documents which collapses headings.
Tab– Collapse/un-collapse selected Markdown heading (
## Heading 2,
### Heading 3, etc.)
Tab– Collapse/un-collapse all Markdown headings
It has also integrated the SublimePandoc package which adds these excellent Command Palette commands:
- Pandoc: Render Markdown to DocX
- Pandoc: Render Markdown to HTML
- Pandoc: Render Markdown to PDF
- Pandoc: Render Markdown to temp HTML and View
- Pandoc: Render Markdown to temp PDF and View
The Pandoc integration requires these Ubuntu packages:
This plugin provides additional Command Palette functions for browsing and updating gists.
Provides source code checking and Python PEP8 style guide validation. Python is natively supported, but other languages may require external lint packages to be installed. It runs in the background by default, but can be configured to run via the Command Palette instead.
This adds various REPL (read-eval-print loop) consoles to the Command Palette which open in a new tab within Sublime. Most interpreted programming languages appear to be supported. Some sample Palette commands:
- SublimeREPL: Python (system python environment)
- SublimeREPL: Sublime Python (sublime python environment)
- SublimeREPL: Python - RUN current file
- SublimeREPL: Python - PDB current file
- SublimeREPL: Shell
- SublimeREPL: Ruby
- SublimeREPL: Clojure
- SublimeREPL: R
Adds Python code completions which can be invoked as-you-type or via
Space. It is smart and seeks out all installed Python libraries and adds those classes to its auto-complete functionality.
In order to use with
virtualenv, you’ll want to create a Rope project in your workspace using the Command Palette and then modify the
config.py file as follows:
Once you’ve done that, it’ll know where to look for all your
vitualenv’s Python libraries and will add those modules to its code completions magic.
Here are all the Code Palette tools:
- Rope: New project
- Rope: Show documentation – Shows the required arguments and doc-string for the selected function
- Rope: Go To Definition – Navigates to the line where selected variable was definied
- Rope: Jump To Global – Similar to Go To Definition. Provides a list of global variables for you to select and then navigate to.
- Rope: Regenerate Project Cache
- Rope: Regenerate Global Module Cache
- Rope: Import Assist
- Rope Refactoring: Rename
- Rope Refactoring: Restructure
- Rope Refactoring: Extract Method
- Rope Refactoring: Extract Variable
- Rope Refactoring: Inline Variable
This plugin parses open & project files for
FIXME comments (or other user-defined patterns) and outputs them to a new tab for display. I frequently stick
TODO comments into Python projects so this is a great solution for managing all my to-do items.
- Show TODOs: Open files only
- Show TODOs: Project and open files
Z– Terminal at project folder (modified via User settings file)
Z– Terminal at current file location (modified via User settings)
Theme - Soda #
Just a great visual theme for the Sublime Text GUI.
Color Scheme - Chubby-er Ninja #
ST2 ships with a dozen or so perfectly useable color schemes, but I found one I liked better on GitHub called Chuby Ninja. I’ve made a few customizations and am titling my version Chubby-er Ninja.
I keep track of it in this gist:
Clearly, Sublime Text 2 is a very extendable text editor. I will try to follow best practices when hacking my plug-ins by modifying Users settings files (instead of Defaults) and by forking git repositories for the plugin whereever possible. I expect to be tweaking a lot of the plugins myself as they are mostly/all written in Python.