Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Awesome vimfiles for Ruby/Rails development
VimL Ruby Shell
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

Great vimfiles for Ruby/Rails development

Support for Rails, Git, Sparkup, Haml, Slim, Sass, Less, Emblem, JSX, CoffeeScript, Markdown Rdoc, and Jade with nice colour schemes.

MacVim with these vimfiles

Quick Install

curl -o - | sh

Please check also install dependencies section.


Basic Mappings

The leader key is mapped to \, you can change it in your .vimrc.local.

Action Hotkey
▶ File operations
File browser (NerdTree) leader ]
FuzzyFinder fo files (CtrlP) leader f
Switch between the last two files leader leader
Toggle Tagbar leader l
View buffer files on current window leader be
View buffer files on horizontal split leader bs
View buffer files on vertical split leader bs
▶ Search & Find/replace
Search in files (Ag/Silver Searcher) leader a
Remove search highlighting leader Space
Toggle search highlighting leader hs
Find and replace leader s
▶ Ruby on Rails
File search in view leader gv
File search in controllers leader gc
File search in models leader gm
File search in helpers leader gh
File search in libs leader gl
File search in public leader gp
File search in assets leader ga
Jump to model leader m
Jump to view leader v
Jump to controller leader c
Open routes in split leader gr
Open Gemfile in split leader gg
Run rspec on current test file leader rt
Run rspec on current line leader rs
Run last rspec file leader rl
▶ Others
Indent >> or Command ]
Reverse Indent << or Command [
Switching between windows ctrl+h ctrl+j ctrl+k ctrl+l
Toggle comments leader / or Command + /
Auto complete or expand snippet <tab>
Expand CSS selectors div.event in to markup ctrl+e

See .vimrc for more.



Lots of stuff - get to know this plugin!

:help rails


CoffeeScript support

Sparkup (ctrl+e)

Expand CSS selectors div.event in to markup <div class='event'></div>


Git integration

Lots of stuff

:Gstatus and press - to stage file

:help fugitive







Want to turn fooBar into foo_bar? Press crs (coerce to snake_case). MixedCase (crm), camelCase (crc), snake_case (crs), and UPPER_CASE (cru) are all just 3 keystrokes away.


Rename the current file

:rename[!] {newname}


Insert a dummy text of a certain length



With bufexplorer, you can quickly and easily switch between buffers

Jsbeautify (\ff)

Format your javascript souce code.


:BufOnly without an argument will unload all buffers but the current one.

:BufOnly with an argument will close all buffers but the supplied buffer name/number.

CtrlP (\f)

Find files in your project with minimal keypresses

For example conadus would find controllers/admin/users

Snipmate (TAB)

Snippets, press TAB to expand

Examples (in a Ruby file):





Gist (:Gist)

Gist current file/selection

Requires setting GITHUB_TOKEN and GITHUB_USER Env's


Align stuff

 \a= :Tabularize /=
 \a: :Tabularize /:
 \a:: :Tabularize /:\zs
 \a, :Tabularize /,
 \<Bar> :Tabularize /<Bar>

Neerd Commenter (Command + / or \/)

Comment/Uncomment stuff out


Search project for text (aka find in files)

Ag (\a)

Alternative of Ack, using 'the_silver_searcher' on homebrew.

Nerdtree (\])

Project file browser

\] opens file browser

o / x open and close files/folders

m menu to move/delete/copy files/folders

? Help

I use nerdtree for creating or moving files, but find CtrlP quicker for opening files.

Surround (ys/cs/ds)

Allows adding/removing/changing of surroundings

I would highly recommend getting to know this plugin, it is very useful. Especially when you grok text objects.


ysiw) - surround inner word with ()

ysiw( - surround inner word with ( )

In the above example iw can be replaced with any text object or motion.

If you find yourself manually adding surroundings, stop and work out the correct text object or motion.

cs"' - change surrounding from " to '

ds - delete surrounding


yss<p> - surround line in <p> tags

cst<div> - change surround tag to <div>


A colour scheme, both light and dark version

:set background=dark

:set background=light

Tagbar (/l)

Lists method names, provide auto complete

Run ctags -R or \rtg in project root to generate tags


Powerline is a utility plugin which allows you to create better-looking, more functional vim statuslines.

See instructions for install the fontpatcher here.


Plugin manager and part of the reason why my vimfiles as so compact


Run Rspec specs from Vim

This version of vim-rspec uses iTerm as default terminal. The original version uses the Terminal app.

Multiple cursors

True Sublime Text style multiple selections for Vim


Install Vim (if not already installed)

MacOS: MacVim

brew install macvim --override-system-vim --enable-clipboard

Ubuntu: gVim

apt-get install vim-gnome

Install these vimfiles

Note: You will already have a ~/.vim folder, either delete or move it.

mv ~/.vim ~/.vim.old
git clone ~/.vim
cd ~/.vim
rake install
ln -s ~/.vim/vimrc ~/.vimrc

or run:

curl -o - | sh

To update to the latest vimfiles

cd ~/.vim
rake update

Install Dependencies

brew install ack ctags the_silver_searcher
sudo apt-get install ncurses-term exuberant-ctags silversearcher-ag ack-grep
sudo ln -s /usr/bin/ack-grep /usr/local/bin/ack

You can download the powerline font for Ubuntu Mono here.

Thanks for inspiration

Something went wrong with that request. Please try again.