A Rails project file for Sublime Text 2

The simplest thing that you can do to open up the Sublime Text 2 editor on your Rails project is to just type in

$ subl .

on the Rails root directory¹.

A slightly better solution is to create a .sublime-project file in your project root directory, so that you may launch the editor with something like

$ subl --project my_rails_project.sublime-project

A question then arises, “How do I exclude useless directories as tmp or log from the project file?”

Answer: just edit the sublime-project file this way:

{
 "folders":
 [
   {
     "path": ".",
     "folder_exclude_patterns": ["tmp", "log"],
     "file_exclude_patterns": [".tmtags"]
   }
 ]
}

(and of course you should adapt it to your actual preferences on what to exclude from your project).

Note that you can also specify a “file_exclude_patterns” property to filter out some files (in my case I wanted to exclude the ctag index file).

  1. to install the command line tool, just follow the docs here.
About these ads

2 thoughts on “A Rails project file for Sublime Text 2

  1. I do believe all of the ideas you’ve presented on your post. They are really convincing and can certainly work. Still, the posts are too short for beginners. May you please extend them a bit from next time? Thank you for the post.

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 )

Connecting to %s