5 Sublime Text tips for a faster workflow

Upgrade the text editor now with these time-saving tips and tricks


01. Split that screen

Anyone who has ever had to work on one of these new-fashioned 16:9 displays is likely to testify to their utter uselessness in day-to-day business. Fortunately, Sublime Text can enable you to work around these problems with the use of its split-screen feature.

Click View then go to Layout to open a menu providing a group of display options. The screenshot above shows the result of the Grid: 4 option. Be aware that the border between the individual subscreens is draggable – you are free to make one part of the window significantly wider than the other one.

What to do with it?
Sublime treats each of the subwindows as an independent instance of Sublime. Menu commands tend to be directed at the window where the cursor currently is located – be aware that multiple cursors are lost when the currently active window is switched or when it has been changed.

Moving tabs between subwindows presents a small challenge of its own: the tab header may not be dropped in the editing area. It must, instead, go into the header area of the new subwindow: if this is not done, Sublime will open a second window instead.

02. Sort that CSS

Browsers don’t care whether your CSS is sorted or not. For developers though, finding attributes can be accomplished much faster if the attributes are sorted alphabetically. Simply select a batch of attributes and press F5 – Sublime will do the rest!

03. Automatic reindentation

Inconsistent indentation leads to strife, war and unhappiness. Sublime Text fixes this with its automatic indent feature. The fastest way to invoke it involves the Command Palette, where it can be selected by entering the string ‘reind’ and selecting the option Reindent Lines

04. No more distractions

Should you feel yourself distracted by the system and/or editor, hit Shift+F11 to enter distraction-free mode. This instructs Sublime to stop displaying system and editor toolkits, leaving you with a pure view of your code. It can be exited at any time by pressing F11.

05. Better search and replace function

Most, if not all, search commands in Sublime can take regular expressions instead of normal texts. This is really helpful in that it allows you to search flexibly – a well-crafted regular expression can grasp permutations such as put1Coin, put2Coin and put3Coin in one command.

When used in combination, they can even be used to create context sensitive replace operations which use parameters from the search to customise the replacement text.

Sublime uses the set of regular expressions commonly known as PCRE. These expressions are all documented fully at regextester.com/regsyntax.html – pay this website a visit and take a look if you ever feel like really speeding up your search-and-replace experience in Sublime.


Warning: file_get_contents(http://newsletter-cms.imagine-publishing.co.uk/web/app_dev.php/api/v1/getwidget/gad): failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error in /var/www/html/gadgetdaily.xyz/web/wp-content/themes/gadgetdaily/newsletter-widget/newsletter-header-include.php on line 9