In my day-to-day work, I am using Sublime Text as my main text editor. It is simple, lightweight but very powerful. It increases my productivity and helps to quickly achieve desired goals. I encourage you to take a couple minutes and read about its features, get familiar with useful tricks, that I am using the most.
Please give it a closer look. Instead just „scan” the article by headings, download Sublime from sublimetext.com and install it. Maybe you’ll also find it useful.
take a shortcut
When is writing code most effective? When you are not touching mouse. Using only keyboard to operate text editor is way faster than moving a mouse cursor and switching options from nested menus. It is only required to get familiar with couple commands and shortcuts unlocking easily manipulation of code and files. Sublime Text comes with a bunch of handy ones.
Ctrl + P
Quick Goto anything. To try it out in the best way, open folder with some project (File | Open Folder…). Once the project is opened, hit Ctrl + P. A small popup will appear. Start typing name of the file you want to open.
Sublime will immediately find it in opened folder. You can also include parts of a path in the search pattern. So given wochaplicont will lead to file within a proper directory.
Moreover, you can append pattern with:
- # – search within the file
- @ – jump to method definition
- : – go to line number
When the work with a file is finished, Ctrl + W closes it, just like in browsers. Ctrl + Shift + W Also reopens.
Ctrl + D
D is one of most erased keys on my keyboard 🙂 I’m using this function all the time. It marks selected string within opened file.
Ctrl + Shift + L
Tired of making the same changes line after line by your hand? Just select these lines, hit Ctrl + Shift + L. Now you have separate text cursors at the end of each line and work in many lines just like it would be one.
Ctrl + Shift + P
This shortcut opens Command Palette. It gives you access to less frequently used functionalities. Also, a popup is opening, similar to Ctrl + P one, but this one searches for commands available in Sublime Text itself and installed additional packages. No more crawling menu with mouse and searching for hidden functionality. One of widely used here is Set Syntax command. Sublime automatically sets proper syntax for most popular file extensions, but for less known needs a little help.
Ctrl + Tab
Great while working with two files. Even if many more files are opened, Ctrl + Tab toggles between two, recently viewed.
Other useful keys:
- Ctrl + / – toggle comment
- Ctrl + [ | Ctrl + ] – decrease | increase indentation
- Ctrl + Shift + K – delete line
- F12 – when triggered for selected variable/method/class jumps to its definition
- F9 – sorts all lines in ascending order
Sublime Text can do a lot but can do more if you want. When basic functionalities are not enough, you can install additional packages. Simply browse them at packagecontrol.io and install easily through command Command Palette ( Ctrl + Shift + P, type install, hit Enter, find the desired package, Enter again, and that’s it). The installation process should be described in the documentation of every extension at packagecontrol.io. If you haven’t found a suitable package, feel free to create your own.
Look for my next post about Sublime Text, I will describe my favorite packages.
As you can see, Sublime Text can indeed improve your work. Are you using it yet? If so, please leave a comment and let me know what are your favorite funcionalities. Or download Sublime today. Just give it a try, and don’t forget to use all goods it brings.