Hans Fangohr, Computational Science
  • Computing home
  • Pages
  • Printing to pdf
  • Linux
  • Python Applications
  • LaTeX
  • ImageMagick
  • Python
  • Asking smartly
  • reStructuredText
  • Units
  • Ubuntu
  • Octave
  • Python installation
  • fonts
  • SublimeText
  • Dvorak keyboard
  • Mercurial Hg
  • Home HF
  • |
  • Computing
  • |
  • SublimeText

Sublime Text 2 Editor¶

[Original text from July 2012.]

The Sublime Text Editor is available from http://www.sublimetext.com/

I am testing the dev releases of version 2 available from http://www.sublimetext.com/dev for Mac OS X, Linux and Windows.

The full version costs money (US$59) but can be evualated free and without time limit.

Setup¶

The first thing to install is the package manager. Follow installation instructions.

The goto Tools->Command Palette and type install. The type the name of the packge you want to install, and select from the list that comes up by using cursor keys and return to select.

Some Useful packages¶

  • hg4subl: mercurial support

  • sublimecodeintel: code analyses tool to support autocompletion

  • sublimeREPL: integrate interactive prompts into sublime buffer

For Python:

  • Pylinter together with

  • SublimeLinter

analyses the Python code as you type, highlights formatting of code that is not recommended, and provides in the status line the reason why the current format is discouraged.

In contrast to most other packages I have seen, PyLinter needs a bit of configuring. In particular, one needs to install the pylint package (using apt-get, fink, port, just easy_install pylint) and tell the package where the pylint package is located. This is done through the Packge settings, which can be reached, for example, through Preferences->Browse Packages then go to PyLinter directory, and edit Pylinter.sublime-settings. For a system with Enthought Python, the relevant line to be modified is:

"pylint_path": "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/pylint-0.25.1-py2.7.egg/pylint",

where the file py.lint can be found in the directory path provided.

Once this is done, a restart of sublime text may be required.

Nice touches¶

Things I have discovered randomly but might be worth remembering:

  • Rigth clicking (CRTL+mouse button on mac) provides a context menu that offers ‘show unsaved changes’ – this produces a diff between the file in the buffer and on disk.

  • if a file changes on disk, the buffer will update and reflect this automatically

  • if the user settings are changed in the user settings file, this is updated the moment the file is saved (try to change the font size in Preferences.sublime-settings, via Preferences->Settings User)

Update March 2015¶

Most of the above still seems to be true. New items I have discovered:

Mercurial path not found: On Mac OS X, I had to install the SublimeFixMacPath package as described at https://plested.wordpress.com/2014/03/14/sublime-text-and-mercurial/ to make Sublime see Mercurial (using the “Mercurial for Sublime” package).

Shortcuts¶

Some kind soul has put together a list of shortcuts at http://sublime-text-unofficial-documentation.readthedocs.org/en/latest/reference/keyboard_shortcuts_osx.html

Documentation¶

More ‘unofficial’ documentation is available at http://sublime-text-unofficial-documentation.readthedocs.org/en/latest/index.html

Another introduction to Sublime Text 2 is available at http://computationalmodelling.bitbucket.org/tools/sublime.html

Return to Top

Created with reStructuredText and Sphinx.