The following is a guest post by Patrick Janson and originally appeared on his blog. Patrick is currently in the Ruby-003 class at The Flatiron School.
I was starting a new .erb file when he told me to stop coding and said that I couldn’t continue to use Sublime anymore until I had installed Package Control. Sublime has package extensions? Mind blown.
How come no one invited me to the sublime package party?
So in case anyone else didn’t get invited to the awesome sublime package party. Here is a quick run down. I installed like 50,000 of them this weekend.
Now I don’t even have to code. I just stare at Sublime and use the
Yoda package to code for me.
For sers though, packages in Sublime are like Gems for Ruby. They give you super powers…or at least auto-complete and some sweet templating options.
Package Control is package manager that helps you extend and modify the Sublime editor. Lets get it installed, add a new package, and remove a package to get familiar with Package Control for Sublime.
Install Package Control – Get Package Control Here
Once here just copy and paste the correct Python code depending on which version of Sublime you have. Below is the code for Sublime Text 2.
Open Sublime and pop open the Sublime console by pressing
crl + `.
Paste the code snippet into the console, press return, and restart your editor.
Channels and Package Installation.
Sublime Packages generally are found in the “Default Channel”. This is channel is the open source forum where developers add their packages and they can be easily searched and downloaded.
The option to create custom channels exists but we won’t touch on that here.
Package Control is evoked through the command palate.
Open the Command Palate:
cmd + shift + pwill pop open the command palate.
Installinto the text area and you will see that package install option will be available.
Select the option
Package Control: Install Package
You will now be able to search by Package name. Even if you don’t know if a package exists that you are looking for. Just type in a few terms and see what comes up.
We are going to install a package called
SideBarEnhnacements. This extension will give us some extra options when we are working on applications that have a robust directory structure.
A concrete example would be that we wouldn’t need to switch to the terminal to type out
mkdirwhen we need a new folder.
Restart your editor after you hit return on
Open any application you are working on and
ctrl clickon the side bar. You will see the enhanced options that the
SideBarEnhnacementspackage we just installed now gave us.
Remove a package
- If for any reason you want to remove a package. Just open the Command Palate again with
cmd + shift + pbut now type
removeand then select
Package Control: Remove PackageThis will allow you to select for your package library what you would like to remove.
Many packages such as Gist require some sort of configuration. If so, you can browse your packages by selecting
browse packages from the Sublime Text preferences dropdown.
There are ton of usefull packages out there and a solid community of people that are interested in pushing the Sublime development tool forward.
Check out the links below for a few that I am currently using and also a search on the Package Control site for all Ruby related packages.
Ruby Packages Search Ruby Package Search.
SideBarEnhancements The one we installed.
HTML5 HTML5 Snippit library.
Gist Create github gists from highlighted texts.
GitGutter See the git status of each line of code.
Make yourself useful.