You won’t be sitting in a SharePoint Experience class for very long before Heather or I open up a code editing app we both love – and for most of you, it’s something you’ve never seen before. Whether it is ASPX, JavaScript, XSL, HTML, PHP or CSS, one of our main go-to applications for web development (and yes this includes SharePoint) is Sublime Text.
First off, Sublime is not:
- a WYSIWYG editor
- an app overflowing with preference screens and checkboxes for options — this may be weird to point out, you should be comfortable with using your keyboard when setting up Sublime
Sublime is:
- available for OS X, Windows and Linux
- customizable and flexible
- infinitely extendable using many free plugins (or write your own, it’s not tough)
- very useful out of the box, incredibly useful if you take a little time to set it up based on your needs
- geek-friendly with a Python console and API
- configured using JSON files — if this sounds scary don’t fret… it just means you edit preferences in the text editor
- awesome!
A lot of great information is posted online about Sublime Text so I am going to focus on getting you set up and pointed to some good resources.
Setting up Sublime Text – Part 1
- Download a trial for Sublime Text online
- You can evaluate it for as long as you like. When ready you can purchase a license for $59 USD (pricing subject to change)
- Open up Sublime, then open the Sublime Console (View –> Show Console)
- Install Sublime Package Control by pasting in the code provided on this web page to the console – don’t forget to restart the app when prompted!
Understanding Packages
A package is just like a plugin. Sublime Text Packages are directories under a master Packages folder on your hard drive. Each directory provides functionality for Sublime, much like how Features (or Apps, if you insist) provide content or functionality for SharePoint. And just like how you have to activate Features in SharePoint, you have to “install” packages in Sublime. In part 1 you installed Sublime Package Control, which will make it very easy to install many different community built packages.
Here are some (maybe eclectic, but we’re super geeks over here) examples to help you get a feel for what different packages can do:
- expand your selection to the next or previous paragraph
- insert custom HTML snippets
- write Lettuce tests with syntax highlighting, auto-completion, and step validation
- send a tweet
- use Emmet (formerly Zen Coding, and damn, so cool) to quickly write HTML/CSS/XML/XSL like a NINJA
- activate syntax highlighting for FreeMarker templates
Adding packages to Sublime using the Package Control is very easy…
Setting up Sublime Text – Part 2
- First pick out a package you think looks interesting or useful. For this example I’ll use Hipster Ipsum.
- In Sublime, type
Ctrl + Shift + P(Cmd + Shift + Pfor Mac) – this will bring up the Command Palette. - Start typing
install. When you use the Command Palette, it will filter possible options as you type. When you typeinstallit should show youPackage Control: Install Package. HitEnter.- Note for SuperGeeks: Sublime prompts use fuzzy matching – try typing
pcipinstead ofinstall
- Note for SuperGeeks: Sublime prompts use fuzzy matching – try typing
- If you look in the status bar you will see Sublime working to load available repositories. Even though the application just looks blank, give it a second and it show you available packages in the Command Palette.
- Once loaded, start typing
HipsterandHipster Ipsumshould pop into view. HitEnter. - Sublime adds the package and you are ready to use it right away. Keep in mind that some packages work best after restarting Sublime – pay attention to the product notes the developer provides.
One of the biggest things to get used to with Sublime is the lack of deeply nested menus and a barrage of preference screens. Instead this code editor is very sleek and trim and gives you the ability to never have to touch your mouse. Through the use of a few keystrokes you have now added a package to the editor and didn’t have to mess with a bunch of dialog boxes or buttons.
If you installed Hipster Ipsum, type the number 3 in the code editor and select it. Hit Ctrl + Alt + H (Windows and Mac). The number will be replaced with three paragraphs of hipster style Lorem Ipsum. If you already have something else bound to those keys (because, hey, you’re cool and already use Sublime), you can also open the Command Palette and start typing hio (first letters of the Hipster Lipsum command) and press enter.
Oh, you want an example?
It is easy to get lost in the sea of package possibilities. Here’s one package that Heather and I go nuts over:
Emmet
Formerly known as ZenCoding, just an FYI…
Among other things, this kick-ass package will expand abbreviated HTML to fully written out and tabbed HTML. Set your syntax to HTML (Command Palette, then ssh to find Set Syntax: HTML) and try this:
div#tabs>(ul>(li>a[href=#tabs-$])*3)+div#tabs-$*3>lipsum
Yeah, seriously. Just copy and paste it. Get ready. It’s going to be legen…
…wait for it…
(now press tab)
…DARY
[gist id=4334534 file=tabsexample.html]
Yeah. That just happened.
I hope to write up some feature posts on specific extensions that I use all the time, or that I find particularly nerdy. While you wait for those posts, here are a few other cool selections:
- Alignment — align selections to matching indent levels
- BracketHighlighter — auto highlights matching open/close brackets
- ColorPick — color picker for the application
- Minifier — Minify JavaScript and CSS files
More Resources for Sublime Text
- Sublime Text Unofficial Documentation — it may have an unofficial title but this is a great guide for how to use Sublime
- Free online video tutorials — an assortment of easy to digest videos on using Sublime
- Sublime Text 2 Documentation — the official Sublime documentation
- Sublime Forums
- Compiled list of time savers — assorted tips and tricks to help you speed up your workflow in Sublime
- Essential Sublime Text 2 Plugins and Extensions — compiled list of some handy packages
Any other questions?
I’d love to hear ‘em. And I’ll do my best to answer ‘em. Let me know in the comments!

[...] Sublime Text is a killer editor I use daily, even with SharePoint. I'll introduce you to Sublime and all the hotness it provides to Web-Powered SuperGeeks. Continue reading → Sublime Text Rocks originally appeared on Our SharePoint Experience Read More… [...]
Thanks for this Dustin, great post. Would love to hear next which package you use for committing to git from sublime and brief how-to.
Ooh, I’m glad you posted this. I have been meaning to try this editor since I took your SharePoint Web Developer Experience class and this was the reminder I needed.
Good day! I know this is kinda off topic but I was wondering which blog platform are you using for this site?
I’m getting sick and tired of WordPress because I’ve had problems with hackers and I’m looking at alternatives for another platform. I would be great if you could point me in the direction of a good platform.
Sorry to hear about your troubles. We are actually using WordPress!