Setup Sublime Text 2 on OSX Mavericks for Ruby on Rails

1. Install Sublime Text 2.

I choose ST2 instead of ST3 simply because I don’t like using beta app for my work.

2. Verify ST2 installation works.  The follow steps refers to the good post at stackoverflow: Sublime Text 3 .subl command

In terminal, go to a folder with a few documents and type:

/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl .

If ST2 opens the folder with documents showed in the left pane, then move on to the next step.  If not, go to the post I provided link and see what you miss.

3. Modify “.bash_profile”

In terminal, type

nano ~/.bash_profile

The file will be showed in terminal, add the following 2 lines in the end of file, then save and exit.

export PATH=/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH↲
export EDITOR='subl -w'

enable the newly edited .bash_profile by typing:

source ~/.bash_profile

4. Create a symlink subl for Sublime Text:

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

Please note I follow the post exactly to place the link file in /usr/local/bin

Now you should be able to use subl to open any text file.

5. Install Package Control, by following this instruction.

6. Install Packages via Package Control (⌘⇧P):

My picks here: Soda Theme, RailCasts Color Scheme, CoffeeScript, Git Gutter, and RubyTest (Ruby test cannot be installed by Package Control but manually, following their instruction on their github page).

7. Edit the Settings – User in Preference.

Mine is as follow:

{
 "caret_style": "solid",
 "color_scheme": "Packages/RailsCasts Colour Scheme/RailsCastsColorScheme.tmTheme",
 "font_face": "Menlo",
 "font_options":
 [
 "no_round"
 ],
 "font_size": 12,
 "ignored_packages":
 [
 "Vintage"
 ],
 "soda_folder_icons": true,
 "theme": "Soda Light.sublime-theme",
 "wide_caret": true
}

Then restart ST2 to activate the setting.

That’s it.  I’ll keep this post updated as I move further in my development.

UPDATE: 2013/11/29

As you know that .scss/.less file for CSS showed in Sublime is pure white by default, we can open a such file and form the menu, go to View > Syntax > [Optional: Open all with current extension as…] > CSS, then all .scss/.less will looks like the other CSS file with color theme.  [Source: Sublime Text 2: How to get scss and Less files to have color?]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s