sublimetext3

Topics related to sublimetext3:

Getting started with sublimetext3

Sublime Text is a sophisticated text editor for code, markup and prose. It has a Python application programming interface (API). It supports many programming languages and markup languages, and its functionality can be extended by users with plugins, typically community-built and maintained under free-software licenses.

Sublime Text 3 is currently in beta. The latest build is 3114.

ST3 runs on the following operating systems:

  • OS X (10.7 or later is required)
  • Windows 32 bit - also available as a portable version
  • Windows 64 bit - also available as a portable version
  • Ubuntu 32 bit - also available as a tarball for other Linux distributions.
  • Ubuntu 64 bit - also available as a tarball for other Linux distributions.

Sublime Text may be downloaded and evaluated for free, however a license must be purchased for continued use. There is currently no enforced time limit for the evaluation.

Build 3103 (released Feb 2016) was the first build available to everyone with the new syntax definition format, .sublime-syntax. This allows for richer syntax highlighting and better performance compared to the legacy .tmLanguage format. 3103 also features a custom regex engine that significantly speeds up file loading and indexing.

Build Systems

Build Systems are output-only, meaning it is not possible to execute some code that will request user input using the build system. The code will just block waiting for input forever. To work around this, many people use a REPL plugin.


JSON keys:

  • shell_cmd specifies the exact command to run in the shell, and has support for variable placeholders (like ${file} that refers to the currently open file).
  • result_file_regex and result_line_regex are used to parse the output from a failed build and show the errors in such a way that it is possible to navigate the editor to where an error occurred.
  • selector is a scope selector that defines what syntax the build is relevant for. There's no point running a Python interpreter on PHP code, for example.
  • variants can be used to allow a different command to be run, for example to just check the syntax of the file rather than execute it. The variants can also specify or override the same JSON keys, and they will apply only to that variant.
  • syntax is used to set the syntax definition file which will be applied to the output panel, thus giving it syntax highlighting.

Package Control

Package Control is the Sublime Text package manager. It includes a list of over 2,500 packages available for install, and users can add any GitHub or BitBucket repository themselves. Once installed, packages are kept up-to-date automatically.

The example code creates the Installed Packages folder for you (if necessary), and then downloads the Package Control.sublime-package into it. The download will be done over HTTP instead of HTTPS due to Python standard library limitations, however the file will be validated using SHA-256.

Essential Packages

Vocabulary

Keybindings

Shortcuts have to be stored in a file called Default.sublime-keymap to be taken into account by Sublime Text.

Platform specific

What if I want to create some shortcuts only for OSX for example?

Well, you can. Just add (<platform>) after the Default. Here are the 3 possibilities:

  • Default (Windows).sublime-keymap
  • Default (Linux).sublime-keymap
  • Default (OSX).sublime-keymap

List of Shortcuts for Sublime Text 3

How to install Sublime 3 on CentOS 7 / RHEL 7?