Pages

Sunday, February 12, 2012

Sublime Text 2 - I'm loving it!


Leaving Notepad++ was not easy. The recommendation for TextMate was loud and clear. But it didn't impress me and the search continued. There came this new kid on the block - Sublime Text 2. I must say it's really Sublime. If you haven't tried yet, download it now - http://www.sublimetext.com/2 Not just mac users, but my ubuntu friends are also leaving their "vi" and gEdit for Sublime Text 2.

My favorite features -

  • multiple cursors - it's incredibly useful!
  • column select
  • crazy fast file switching - include 'Go to anything' search (cmd + p)
  • context specific search and replace
  • side by side multi-pane editing (like :vsp in vim)
  • auto completion 
  • bookmarks (like in vim)
  • distraction free mode
  • Snippet support 
  • Zen coding support 

And there is a package manager which makes installing new packages a piece of cake.

Terminal command to open up Sublime Text 2
It's simple, just create s symlink and add it to your PATH
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
Edit your ~/.bashrc or ~/.bash_profile to add this -
PATH=$PATH:~/bin
export PATH

Install package manager-

Open Sublime text 2, you can use subl command in your Terminal now.
Open the console by clicking View -> Show Console  and paste this in the console and hit enter. import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation'
Restart Sublime Text 2 to complete the installation process.
Presse cmd + shift + p to access the command pallet and then type 'Install packages" and hit Enter.
This will open up a list of all available packages. Select the package from the list and Enter. That's it. It will download the package and install it for you.

Here is the list - http://wbond.net/sublime_packages/community

A very quick way to create new folders and file - cmd + alt + n -
Happy Coding!

3 comments: