Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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.
.gitignore
README.md
Rakefile
bundles.vim
install.sh
vimrc

README.md

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 https://raw.github.com/josemarluedke/vimfiles/master/install.sh -o - | sh

Please check also install dependencies section.

Usage

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.

Plugins

Rails

Lots of stuff - get to know this plugin!

:help rails

CoffeeScript

CoffeeScript support

Sparkup (ctrl+e)

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

http://net.tutsplus.com/articles/general/quick-tip-even-quicker-markup-with-sparkup/

Fugitive

Git integration

Lots of stuff

:Gstatus and press - to stage file

http://vimcasts.org/episodes/fugitive-vim---a-complement-to-command-line-git/

:help fugitive

Abolish

Use:

:%Subvert/facilit{y,ies}/building{,s}/g

Instead:

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

Coercion

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

Rename the current file

:rename[!] {newname}

Loremipsum

Insert a dummy text of a certain length

:Loremipsum[!] [WORD    COUNT] [PARAGRAPH_TEMPLATE] [PREFIX POSTFIX]

Bufexplorer

With bufexplorer, you can quickly and easily switch between buffers

Jsbeautify (\ff)

Format your javascript souce code.

BufOnly

: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):

def<tab>

.each<tab>

.eado<tab>

ife<tab>

Gist (:Gist)

Gist current file/selection

Requires setting GITHUB_TOKEN and GITHUB_USER Env's

Tabular

Align stuff

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

http://vimcasts.org/episodes/aligning-text-with-tabular-vim/

Neerd Commenter (Command + / or \/)

Comment/Uncomment stuff out

Ack

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.

Characters

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

Tags

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

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

Solarized

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

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

See instructions for install the fontpatcher here.

Vundle

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

Rspec

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

Installation

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 https://github.com/josemarluedke/vimfiles ~/.vim
cd ~/.vim
rake install
ln -s ~/.vim/vimrc ~/.vimrc

or run:

curl https://raw.github.com/josemarluedke/vimfiles/master/install.sh -o - | sh

To update to the latest vimfiles

cd ~/.vim
rake update

Install Dependencies

MacOS
brew install ack ctags the_silver_searcher
Ubuntu
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.