Vim script Ruby Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Awesome vimfiles for Ruby and Javascript development

Support for Javascript, Ember, React, Ruby, Rails, Git, Sparkup, Slim, Sass, JSX, CoffeeScript, Markdown, and more with nice color schemes.

Neovim compatible!

MacVim with these vimfiles

Quick Install

curl -o - | sh

Please also check 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 m
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
Multiple Cursor ctrl+n
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
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
Split a one-liner into multiple lines (splitjoin.vim) gS
Join a block into a single-line statement (splitjoin.vim) gJ
Paste from yank history using append (neoyank.vim) leader p

See .vimrc for more.



Lots of stuff - get to know this plugin!

:help rails


Similar to vim-rails, but for Ember.js.

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





:%s/facilities/buildings/g :%s/Facilities/Buildings/g :%s/FACILITIES/BUILDINGS/g


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


: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 (<leader>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 /, :Tabularize /

Neerd Commenter (Command + / or <leader>/)

Comment/Uncomment stuff out


Search project for text (aka find in files)

Ag (<leader>a)

Alternative of Ack, using 'the_silver_searcher' on homebrew.

Nerdtree (<leader>])

Project file browser

<leader>m 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 (<leader>l)

Lists method names, provide auto complete

Run ctags -R or <leader>rtg in project root to generate tags


Lean & mean status/tabline for vim that's light as air


Plugin manager and part of the reason why my vimfiles are 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

This is similar to Command + d from Atom/Sublime.

Ctrl-n to activate and to go to the next match. When you are tired, simply change the word under the cursor the usual way.

<Leader>d to clean highlight.

Format JSON strings

If you have a one line JSON string and want to indend and format it you can use this command:


Disable directions key navigation

If you are not used to use hjkl keys to navigate throught files, I recommend adding the following code to your ~/.vimrc.local to disable navigation using the arrows keys. This will make you use hjkl keys instead of arrows.

noremap <up>    :echoerr 'Use K to go up'<CR>
noremap <down>  :echoerr 'Use J to go down'<CR>
noremap <left>  :echoerr 'Use H to go left'<CR>
noremap <right> :echoerr 'Use L to go right'<CR>


Install Vim (if not already installed)

MacOS: MacVim

brew install macvim --with-override-system-vim --enable-clipboard  --with-cscope --with-lua

Ubuntu: gVim

apt-get install vim-gnome

Ruby and NeoVim users

Remember to install the neovim gem to get deoplete completing ruby code. Execute: sudo gem install neovim

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

Thanks for inspiration