Emmet and sublime text 2 (or 3, 3 is Alpha version yet) might be one of the best combos to boost your work flow when writing an application. Sublime text is my favourite editor since I broke up with geany. :P
Sublime text 2
We all know sublime text 2 editor, right? It’s a cross platform text editor with python API, full of awesome features while keeping things simple but not simpler, super fast, expandable, themable, highly configurable (remember: keystrokes are our wingmen). To mention some of my favourite keystrokes…
Ctrl+Shift+P => is command palette so you can type sshtml, on a new file, to set syntax to html etc.
Ctrl+P => is a “GoTo anything” functionality which allows you to search from file names to functions among your project files.
Ctrl+D => selects next occurrence so you can replace all vars inside your 1k lines code sheet by only changing the current one.
Ctrl+K => deletes one or more lines of code. you can mark as many as you want with Ctrl+LMC (left mouse click)
Ctrl+Shift+/ => comments the selected lines, character or whatever with multiline comment tag
Ctrl+/ => single line comment
=> opens python console (Notice that keystroke, we're going to use it to install emmet from package control later)
Emmet is an editor plugin which helps us to insert snippets (web-dev languages for now) in new way. For more information check the links below.
Emmet installation for Sublime Text 2
- Open sublime text 2
- Ctrl +
- Paste the code below to setup Package Control for sublime
Python123456789101112import urllib2,os,hashlib; h ='7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0';pf = 'Package Control.sublime-package'; ipp =sublime.installed_packages_path(); os.makedirs( ipp ) if notos.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen('http://sublime.wbond.net/' + pf.replace(' ', '%20')).read(); dh =hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb').write(by) if dh == h else None; print('Error validating download (got%s instead of %s), please try manual install' % (dh, h) if dh != h else'Please restart Sublime Text to finish installation'<code><span class="smalltalk"><span class="symbol">
- When it’s finished you’ll have to restart sublime text
- press Ctrl + Shift + P and then type: install package and press enter. Wait until packages menu appear and type “emmet” then press enter to install. It will take 10-20sec to complete.
- open a new file (Ctrl+N), press Ctrl+Shift+P, type sshtml, hit enter, type html:5, hit tab. Voilà!