{"id":189015,"date":"2014-11-24T09:25:14","date_gmt":"2014-11-24T16:25:14","guid":{"rendered":"http:\/\/css-tricks.com\/?p=189015"},"modified":"2017-04-12T17:00:43","modified_gmt":"2017-04-13T00:00:43","slug":"sublime-text-front-end-developers","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/sublime-text-front-end-developers\/","title":{"rendered":"Sublime Text for Front End Developers"},"content":{"rendered":"

The following is a guest post by Wes Bos<\/a>. Wes has been writing about Sublime Text and all the great stuff it brings to code editing for a while now. He has a new book and video package out now: Sublime Text Power User<\/a>. I met him at a conference recently and saw his talk on Sublime Text. The conference was buzzing about it. Newbie’s jaws were dropped and old pro’s learned new tricks. Here, Wes is going to share some of best stuff as it relates to front enders like us.<\/em><\/p>\n

<\/p>\n

With Sublime Text<\/a> being one of today’s hottest editors for web development, it’s important to know the ins and outs of the editor as it relates to front end development. Rather than being a step by step guide on Sublime Text, this post is filled with hot tips, tricks and packages that will make you amazing with Sublime Text.<\/p>\n

Syntax Highlighters<\/h3>\n

It’s almost 2015 and a ton<\/strong> has changed in the last few years – CSS has exploded with new features, JavaScript has introduced new functionality and syntax and we have a handful of new languages that compile into HTML, CSS or JavaScript. The syntax highlighters that come with Sublime are old, and even unavailable for some languages. <\/p>\n

The following packages will allow for the best possible syntax highlighting. Even if you already have syntax highlighters for all of your languages – give this a read as you may wish to change a few of them.<\/p>\n

The JavaScript Next<\/a> syntax highlighter provides better code highlighting than the default JavaScript highlighter as well as support for ECMAScript 6 features such as modules, succinct methods, arrow functions, classes, generators, and accessors (ES5).<\/p>\n

CSS3<\/a> provides highlighting for every CSS3 feature in the spec. That is everything new as well as things that are yet to be implemented. This should totally replace any existing CSS syntax highlighting that you have.<\/p>\n

Sass users should install the SCSS<\/a> package. Heads up – it’s a common mistake to search and install the Sass<\/a> when you really aren’t writing the Sass syntax, but the Scss syntax – make sure you have the right one enabled so that all other packages, like Emmet, continue to work properly.<\/p>\n

<\/figure>\n

Of course there are are also Stylus<\/a> and LESS<\/a> packages available if they are your CSS weapon of choice.<\/p>\n

Write Coffeescript? Make sure you have the Better-Coffeescript<\/a> package installed. It’s important to grab the better-coffeescript<\/strong> package as the regular CoffeeScript package is no longer maintained. There is also a Typescript Package<\/a> those in that camp.<\/p>\n

The Haml<\/a> package extends the default Haml package to include nested languages such as JS, CSS, Sass, etc, so you can maintain both your highlighting and snippets. The Slim<\/a> and Jade<\/a> packages provide much needed highlighting to these newish markup languages.<\/p>\n

Packages and Plugins<\/h3>\n

Sublime owes much of its popularity to the endless supply of interesting and helpful packages that the community has created. If you are new to Sublime, you can add and manage your packages with Package Control<\/a>. <\/p>\n

While we could sit around all day and talk about the best Sublime Packages, and I hope you do in the comments, these are a handful of must-have packages for a front end developer working with HTML, CSS and JavaScript.<\/p>\n

Color Highlighter<\/h4>\n

When working with colors in a stylesheet – it’s helpful to have some sort of visual aid showing you the actual color. Color Highlighter will scan your stylesheet and color your color name, hex code or RGBA by filling in the background with that color. There are options to underline with the color or display it as a circle in the gutter. <\/p>\n

<\/figure>\n

Recently, support for Sass, LESS, and Stylus variables have been added, which makes this tool ready for almost any workflow!<\/p>\n

Emmet<\/h4>\n

Almost everyone already knows about Emmet<\/a> and many have been using it since the Zen Coding days. However, I’ve found many developers are missing out on some of the powerful features of Emmet.<\/p>\n

HTML<\/h4>\n

Emmet is great for writing HTML very quickly. Simply type the CSS selector for the markup you wish to have and hit tab. Use Jade, Slim or Haml? Emmet works with those markup languages too!<\/p>\n

<\/figure>\n

This can be as simple or as complicated as you want. Here are a few examples \u2014 be sure to check out the cheat sheet<\/a> for all the possible ways to use Emmet with HTML.<\/p>\n