While recently upgrading from Sublime Text 2 to Sublime Text 3 I realised I had never written down which plugins I use on a regular basis with most, if not all, projects.
This post will go through the plugins I use, a little about what each plugin does, and any other setup I may have. All of the settings and plugins are personal preference, if you are using this as a guide to pick your own plugins, feel free to pick any you want, in any order.
Plugins
In total, I use 11 main plugins for Sublime. The plugins are listed below, with links to their appropriate web pages.
Plugins Used
- Package Control
- Emmet
- SublimeLinter3
- This also includes various linter plugins.
- SideBarEnhancements
- Alignment
- DocBlockr
- Git
- GitGutter
- AllAutocomplete
- Hex to HSL
- SublimeCodeIntel
Package Control
This one is a must, without it, installing all of the other plugins becomes a much more complicated task.
Using package control, you can simply hit cmd + shift + P
on a Mac, or ctrl + shift + p
on Windows, then type in Package Control
and you will be presented with a set of options to help you manage your packages.
Emmet
A very handy plugin for rapid html writing. Simply creat a block of code like so.
div.container>div.row>div.col-md-5+div.col-md-7
This code above will output the following html when you hit tab at the end.
<div class="container">
<div class="row">
<div class="col-md-5"></div>
<div class="col-md-7"></div>
</div>
</div>
As you can tell, this has many uses and is extremly valuable in day to day development.
SublimeLinter3
A simple plugin to help with checking for errors in your code.
When an error is found, the line will be marked in the sidebar and the incorrect code will be highlighted.
Sidebar Enhancements
This simple plugin adds some much needed enhamcement to the default Sublime sidebar. When right clicking on a file you now have many more options, such as reveal (open in finder/explorer), open/run, open in browser, find & replace, and so on. The same options are also added to folders.
Alignment
A very simple plugin to help align your code. This is most useful for aligning arrays.
<?php
$array = [
'my_key' => 'my_value',
0 => 'some other value',
'another_long_key' => 'a value here'
];
?>
The above array will be transformed into the following.
<?php
$array = [
'my_key' => 'my_value',
0 => 'some other value',
'another_long_key' => 'a value here'
];
?>
DocBlockr
This plugin makes is simple and easy to create DocBlock comments on code. It also looks at the code you have and adds in any appropriate comment values, such as @param
and @return
.
This plugin is invaluable when coding in PHP, and I would imagine it is pretty useful in other languages as well. To use it, just simply type the start of a DocBlock (/**
) and hit the tab key.
Git & GitGutter
Git adds in some commands to run git from within sublime. I honestly don't use these all that much as I tend to use GitFlow instead, but they can be useful.
GitGutter adds some useful icons to the gutter of your page, these icons show new lines of code, modified lines and so on.
AllAutocomplete & SublimeCodeIntel
These two plugins help with autocompletion. Instead of only looking within the current file you have open, they will look in other open files and other files with in specified directories.
This makes it much easier when you are attempting to call a method and you are unsure on the paramaters required or the exact method name.
Themes
My personal choice of theme for Sublime Text 3 is the Predawn Theme. This theme is clean and simple, but adds some nice colour to things without being too bright. Combined with the provided color_scheme, it makes for an enjoyable coding experience.
This theme can be installed through Package Control by searching for Predawn
. Once installed, a few changes need to be made to your Preferences >> User
file.
"color_scheme": "Packages/User/predawn (SL).tmTheme",
"theme": "predawn.sublime-theme",
"tabs_medium": true,
The tabs_medium
setitng above just changes the size of the tabs. I find the default size slightly too large.
Font
For a nice and clean font, I use the Source Code Pro
font from Adobe. Found here.
This is combined with a size 16 font for clear reading.
For font settings, I use the Source Code Pro
font from Adobe. This is used with a size 16
font for clear reading.
To change your font in sublime, open your Preferences >> User
file and add the following lines.
"font_face": "Source Code Pro",
"font_size": 16,
Rulers
For rulers, I use a rule of 80 and a rule of 120. These are the same line lengths recommanded in the PHP PSR-2 Coding Style Guide found here.
Rulers can be set by modifying your Preferences >> User
file to add the below code.
"rulers": [80, 120]
Closing Notes
This article covers the basic and main setup I use for Sublime Text 2 and 3. While I may (and do) have other plugins I use, the ones listed above are the most frequently used and most useful out of the list.
Feel free to comment below with your opinion on the plugins mentioned and let me know what plugins you use!