Sublime Text: Beginners guide

Introduction

Sublime Text is a powerful and lightweight (compared to Atom or Visual Studio Code) text editor, one of the most used and with lots of useful plugins, called Packages. It needs a little configuration because the stock installation is even too lite and lack of some features, that can be added installing packages, as we’ll see below.

The most important and useful function in Sublime Text is the Command Palette, pressing Ctrl + Shift + P will open this command line that allows you to do anything.

Settings in Sublime Text are accessible pressing Preferences -> Settings. This open a split screen text editor, showing Default and User Settings. I suggest you to modify User Settings with you preferences, these are mine:

Remember when you modify settings to save them (Ctrl + S) and, sometimes, restart Sublime to see the effects of  the settings you edited.

I suggest you to set a folder to visualize on the left bar, pressing File -> Open Folder to keep your text files together.

Hints

Sublime Text have millions of functions and shortcuts, some of the best are:

  • Shift + Click Dx is the hotkey for square selection, also knows as Columns Mode Editing, that allows editing more rows at the same column simultaneously
  • When you paste a text, and you don’t need to save it but you want to see the sintax higlitighted, you can simply press Ctrl + Shift + P and then type, for example, synt sql , choose Set Syntax: SQL and press Enter, your file will be highlighted
  • Ctrl + P open the file search panel ‘Goto Anything’

Packages

First of all, you have to install Package Control that is the most used Package repository and allows you to easily install them. Follow the instruction of this official link to install Package Control.

When you have done, you can install Packages simply opening the Command Palette (Ctrl + Shift + P) , type ‘install package‘, select Package Control: Install Package and then type the name of the package. These are the basic Package I suggest

  • Trimmer: allows you to trim leading and or trailing whitespaces
  • BracketHighliter: a visual highlighter of matching brackets
  • Compare Side-By-Side: visual side-by-side file comparison & difference tool
  • Log Highlight: provide highlight for log files
  • Filter Lines: can extract or remove entire rows of a file using a regex
  • SFTP allows you to connect to a server via FTP or SFTP for opening and modifying text files

The best way to use the functions of a Package is (you will never guess it!), again, the Command Palette!
Press Ctrl + Shift + P and then type the name of the package (or a sub string of the name) to see the possibility that it offer, for example typing fil lin you will see the functions of Filter Lines and could choose between Fold Excluding Regex or Exclude line with Regex .

(EDIT: the recently added stock theme Adaptive.sublime-theme  IMHO is the best choice, set it by typing in the Command Palette theme, but you can also try custom themes as described here)
Another thing you can install are themes,  I suggest Theme – Soda created by buymeasoda, nice and really ready to use after a simple installation. Install the package as you learned before (Ctrl+Shift+P , select Install Package and then type Theme – Soda). In User Settings add the line:

You can also install an icon pack, I suggest A File Icon.