• Martin Thoma
  • Home
  • Categories
  • Tags
  • Archives
  • Support me

Sublime Text

Contents

  • Installation
  • Package Control
  • Configuration
  • Command Palette
  • Plugins
    • LaTeXTools
    • BracketHighlighter
    • Alignment
    • Colorsublime
    • TrailingSpaces
    • Wrap Plus
    • Python Flake8 Lint
  • Themes
  • Custom Keybindings
  • Custom snippets
  • Buildin Keybindings
  • What could be better
    • Chrome-like Tabs
    • Line Wrapping
    • Support for Tooltips
  • More

Sublime Text is the coolest editor I have ever used. It has a lot of features, is blazingly fast as I expect it from every editor and has a convenient configuration. It is available for Linux, Windows and Mac. You can use it for free without any restrictions as long as you want. But keep in mind that somebody had to develop this nice software.

Installation

You can get a free version from sublimetext.com or you could install it on Linux Mint via

sudo apt-get install sublime-text

I've added a symlink to make it easier to call it from command line:

sudo ln -s /opt/sublime_text/sublime_text /usr/local/bin/sublime

The editor is usable right after the installation, but you might want to make some fine-tuning.

Package Control

The Package Control plugin should definitely be installed. It makes installation of other packages so much easier. After you have installed it, you can press Ctrl+Shift+P to get this dialog:

Sublime Tabs
Sublime Tabs

Configuration

Sublime Text offers plenty of configuration options. You can apply them to projects, users or system wide. Most of the time, I change my preferences for me via Preferences > Settings - User:

Preferences > Settings - User
Preferences > Settings - User

Here is what I have changed:

{
    "WrapPlus.break_on_hyphens": false,
    "color_scheme": "Packages/User/textmate (Flake8Lint).tmTheme",
    "detect_indentation": false,
    "draw_white_space": "all",
    "fold_buttons": true,
    "font_face": "Ubuntu Mono",
    "font_size": 15,
    "highlight_line": true,
    "rulers":
    [
        79,
        120
    ],
    "scroll_speed": 0,
    "search_threshold": 1000000,
    "tab_size": 4,
    "translate_tabs_to_spaces": true,
    "use_tab_stops": false
}

Note that you have to install the color scheme and the font (source) to use it.

Command Palette

You can get to the command palette by Ctrl + Shift + P. This opens such a dialog:

Command Palette
automatical alignment

This will do a fuzzy search through all elements in the menu. So you don't need to use Alt + arrow keys no longer. I love it ☺

Plugins

LaTeXTools

The LaTeXTools package adds support for LaTeX. It adds shortcuts, a pull-down menu when you enter \cref{ and much more.

BracketHighlighter

BracketHighlighter adds brackets on the left side. It looks like this:

Highlight braces
Highlight braces

Alignment

Sublime Alignment gives you the possibility to mark text, press Ctrl+Alt+a to align:

automatical alignment
automatical alignment

Colorsublime

Colorsublime is a plugin for theming Sublime Text&nbps3 within seconds. Take a look at colorsublime.com for some examples.

TrailingSpaces

Tools for easy removing trailing spaces with Ctrl + Shift + T. See GitHub repository.

Wrap Plus

Tools for easy wrapping lines with Alt + Q. See GitHub repository.

Python Flake8 Lint

Highlight potential problems with Python code. See GitHub repository.

Themes

First of all, make sure you have installed the Colorsublime package. After you have it, you can press Ctrl + Shift + P and enter "Install Theme". Then it contacts the server and provides you a list of many good themes. You can go through them with the arrow keys and they will instantly be applied!

I really like the "Textmate" theme, but the "Chrome_DevTools" theme is also good.

Custom Keybindings

You can create custom keybindings via Preferences Key Bindings (User)

I have these:

[
{ "keys": ["ctrl+shift+r"], "command": "reindent", "args": { "single_line": false } },
{ "keys": ["shift+tab"], "command": "unindent", "args": {"single_line":true} },
{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } },
{ "keys": ["ctrl+shift+t"], "command": "delete_trailing_spaces" }
]

Custom snippets

Snippets are a very cool feature of ST. They allow you to enter some text, press Tab and get whatever you wanted. So you could create a new .tex document, enter article, press Tab and get a template for a LaTeX document of the article document class.

A tutorial how to create a snippet for the article document class was written Jonathan Page: Creating Snippets in Sublime Text 2 for LaTeX

Buildin Keybindings

Ctrl + p: Goto file

Ctrl + Shift + P: Goto anything

Ctrl + r: Goto section

Ctrl+R in Sublime Text
Ctrl+R in Sublime Text (LaTeX)
Ctrl+R in Sublime Text
Ctrl+R in Sublime Text (Markdown)

Ctrl + Shift + Up / Down: Move the current line one line up / down

Shift + F11: Distraction free mode

Distraction free mode
Distraction free mode

Ctrl + D: Multi-Select

What could be better

Chrome-like Tabs

Look at this:

Sublime Tabs
Sublime Tabs

Now compare it to this:

Chrome Tabs
Chrome Tabs

Chrome tabs look much cleaner, don't they? Many others seem to think that, too (source).

Line Wrapping

Sublime Text 3 does wrap points and commas to the next line:

line wrapping
line wrapping

This behaviour is bad and not liked by the community (source).

Support for Tooltips

It would be absolutely great for many plugins like linters if they could make use of tooltips.

Any news on tooltip and sidebar API? Are you planning to implement this (ever? :mrgreen: ) It's something I very much want to get done, but at this stage I don't know when that will be.

Source: Sublime Text Forum: Sublime Text 3 Beta

More

  • Documentation
  • colorsublime.com: Lots of themes
  • tmtheme-editor.herokuapp.com: Adjust your theme online
  • Sublime Text 2 Video Tutorials: A series of 32 video tutorials for Sublime Text 2. At least the first few are the same in ST 3.

Published

Mär 1, 2014
by Martin Thoma

Category

Code

Tags

  • Editor 3
  • Software Development 16
  • Sublime Text 2

Contact

  • Martin Thoma - A blog about Code, the Web and Cyberculture
  • E-mail subscription
  • RSS-Feed
  • Privacy/Datenschutzerklärung
  • Impressum
  • Powered by Pelican. Theme: Elegant by Talha Mansoor