Hello readers,

Look at your editor ... Now back to mine

SB2

Now back at your editor ... now back to mine.

SB2

Sadly, its not mine. But if you stopped using that old editor and took a few minutes to read this blog, it very well could be *ahem*

what is it?

Sublime Text is a cross-platform text and source code editor, with a Python API for all the plugin developers out there to get their teeth into. With plugins, this humble editor can become a powerful and extremely slick IDE for almost any area of development. It has rallied a large following and, as a byproduct of this, has an extensive library of plugins and snippets that are lovingly maintained to a very high quality by its community. You can download it here.

Why do we care?

If the gorgeous look of this software won't tempt you then here are my personal top reasons for using it.

Two simple words : multiple cursors

This is by far, the single most impressive aspect of Sublime Text. After using this you will NEVER go back to an editor that does not offer this kind of functionality, end of story, with no exception. "Make ten changes at the same time, not one change ten times," this function allows you to interact using as many cursors as you need to change many lines at once and manipulate massive files with total ease.

Here is a Guide on how to start using Multiple Cursors.

Speed speed and ... speed

Sublime laughs at splash screens and loading bars. Its amazingly fast with a startup time of under a second and the same for closing. It also remembers where you were and what you were doing on the next startup. Oh, and it handles large files (Mostly ;) ) like a dream! Its project management system is very powerful, with each project being able to have its own individual group of settings.

Another great project oriented feature is that it can remember where you were within any project at any one time. This makes jumping from project to project extremely easy and ludicrously fast as you're not constantly going back to where you were ... and its all set to keybinds! Here is a guide on Navigating Files. Here is a guide on Using Projects.

For comparison, it takes me two minutes to do the same with Visual Studio, requires mouse point and click for a lot of its functionality, and can only handle one solution (thats a large more complex form of a project to you and me), and it often hangs when processing a request.

Settings, oh the settings!

Like many other people in my industry: I'm very, VERY, picky over my editor. If i'm not enjoying the software, my work suffers massively. Because of this I am a major fan of programs that provide extensive customisability. In this respect Sublime Text shines. There is no GUI for any setting, no check box, no slider and no on/off.

What you will find however is a set of JSON files that are accessed and edited through the preferences menu in the top bar. Through this, you can change literally whatever you want and it also allows you to mold the editor into something that suits you perfectly. Don't like that keybind? Change it. That colour tab annoying you? Well guess what? Change that too.

With regards to how the editor behaves; in certain situations it can be changed or even removed. If you can code, you can basically do what you like. Pro Tip! - Only edit the user files. This is because when sublime updates, the default files will be overwritten and you will lose all of your customisations; also if your changes break anything then they are easily remedied. See here for a Guide on Keybinds.

Its build systems

Sublime Text has another really powerful tool; they call it the Build System. In this, you are able to run build programs such as 'make', either when a key in pressed (F7 by default) or when a file is saved. This can be used when you want to compile some code or even run a batch file. This tool is very useful and is something I personally use on a daily basis.

One of my most used build systems is a custom system I use to run batch files. Here is an example of this very basic build system. Here is a guide on Build Systems.

Plugins

All of the below plugins are obtainable through the package manager. This is a very useful tool inside Sublime Text that streamlines the plugin installation process immensely. Please see this video for a guide on how to set it up and start using it. So without further ado, I present to you my favorite plugins.

Emmet

Emmet (previously known as Zen Coding) is a web-developer's toolkit that can greatly improve your HTML & CSS workflow: Basically, most text editors out there allow you to store and reuse commonly used code chunks, called "snippets". While snippets are a good way to boost your productivity, all implementations have common pitfalls: you have to define the snippet first and you can't extend them in runtime.

Emmet takes the snippets idea to a whole new level: you can type CSS-like expressions that can be dynamically parsed, and produce output depending on what you type in the abbreviation. Emmet is developed and optimised for web-developers whose workflow depends on HTML/XML and CSS, but can be used with programming languages too. Here is a guide on Emmet.

Nettuts+ fetch

Fetch has become a must for me when starting a new project or reusing code resources. It allows you to find, download and extract anything you want straight into your project. For example I have these (among other things) set up for HTML5 Boilerplate, MODx CMS and Wordpress CMS.

This means that I can download the latest version of these packages and extract them into my project in under five seconds. Now that is efficiency! Here is a guide on NetTuts+ Fetch.

Livereload

Where would my life be without this little gem? Very easy to set up and (once set up) is invisible and super lightweight. It basically allows you to make edits to any front end code work and see it live without having to refresh your browser. You will need the chrome extension which is here. Here is a guide on Livereload.

Advancednewfile

AdvancedNewFile is an invaluable little plugin for anyone optimising their workflows. It allows you to create a new folder or file from within Sublime Text completely with keybinds. This action is performed in seconds and, once you have started using it, you will find every other method clunky and needlessly slow. Pro Tip! In "Key Bindings - User" add this. It will replace your normal "crtl+n" function with the plugins:

{ "keys": ["ctrl+n"], "command": "advanced_new_file"},
{ "keys": ["ctrl+alt+n"], "command": "new_file" }

Here is a guide on AdvancedNewFile.

Sidebar enhancements

I cannot stress enough the need for this plugin; if not for anything else other than the "View in Browser" function, which is a must if you're using Sublime Text as your IDE. It also comes with other useful things like "move to trash" and "copy paths as URIs;" very useful for filling in those fiddly file paths. Here is a guide on Sidebar Enhancments.

Sftp

Every good IDE should have built in FTP. Most don't, but they should anyway. When looking to make Sublime Text as "All-in-one" as possible, this becomes an essential. Nothing is faster than working directly from your server and this is what this plugin allows you to do.

Its also an important addition to your workflow if you're using a SCM as it'll allow you to upload all of your changes to the server after you have committed to your SCM. Here is a guide on SFTP Plugin.

Scm support git/svn

Using a SCM is an important aspect of any developer's skill set. The sublime community and the Sublime Text developers themselves have worked hard to integrate the major SCM players into their platform. The two we are looking at are Git for Sublime and SVN for Sublime: Git for Sublime was created by the community to integrate Git SCM into their editor.

It provides essential git commands that are easily accessible within the editor for easy use. This makes the need to leave Sublime to perform all but the most complex SCM functions completely redundant. This is a good efficiency boost. SVN for Sublimeis a plugin that was developed by Will Bond to integrate SVN SCM into his platform.

Same as above, it provides functionally that caters for all but the most complex requests. A must if you use SVN.

Gist

Need a place to store all those reusable bits of code? Sure you can store them in snippets but what if you want to share them? Now lets take it a step further: You need a platform to share your really cool and god-like coding skills but you don't want to leave your editor ? Check this plugin out. Here is a guide on Gist Plugin.

Msbuild

MSBuild is designed with ASP.Net in mind. Its a package of autocomplete, syntax highlighting and build systems for .Net developers. Unfortunately, as far as I'm aware, this is all that the community has to offer for .Net developers as of yet.

Vbscript

Again this is only recommended for reading and basic editing of VB but at least it's something eh? VBScript provides autocomplete, snippets and syntax highlighting.

Find function definition

Until Sublime Text 3 is fully released, we will have to stick with this cool little nugget. This plugin is a total essential for anyone who's used to IDEs like Visual Studio or Netbeans and miss the easy definition referencing.

Theme - pheonix

If you have already installed Sublime Text 2, you may have noticed that mine looks a little different to yours. This is because I have installed and customised a theme. Having said that, there is absolutely nothing wrong with the original. In fact, it's stunning - as seen below:

20121122135300!Sublime-text-2-screenshot

It's just my personal preference. If you like the theme I have (as seen at the start of this article) then please see the below Pro Tip for the customisations. Pro Tip!Copy and Paste this into "Settings - User" to get my exact custom look.

{
 "color_scheme": "Packages/Theme - Phoenix/Color Scheme/Tomorrow-Night.tmTheme",
 "font_size": 15,
 "ignored_packages":
 [
 "Vintage"
 ],
 "phoenix_color_expanded_folder": true,
 "phoenix_dirty_bottom_bar_red": true,
 "phoenix_sidebar_tree_large": true,
 "phoenix_solid_current_tab": true,
 "theme": "Phoenix Dark.sublime-theme"
 }

Docblockr

If you are a fan of detailed and concise commenting in your code (and you should be! >.< ) This plugin is for you... So thats all of you yeah? Hmmm... This is a very intelligent plugin that will provide you with templates for commenting based on the code you need to comment on. It auto detects and is activated with a basic keybind.

As far as I have seen, it's never been wrong. Here is a guide on DocBlockr.

Pretty tasks

Task management right from the editor. I wouldn't suggest you use it as your main task manager but its very handy for tracking to-do relating to your project. Here is a guide on Pretty Tasks.

So yeah

I hope you found this blog post interesting. All in all, its a very VERY good editor. Please give it a go! Even if it's just a quick look - because when you test these waters, you'll find it's calm and smooth sailing ahead!

Back to blog
Meet the author ...

Andy Headington

CEO

Andy has been part of Adido since it was an idea in a pub nearly twenty years ago. He loves to work with the Adido team and all of the clients on board asking challenging questions and ...