Ruby/Rails based vimfiles and installer
With the support for ruby, git, rvm, rails, rspec and so on.
Vim 7.3 or better Tested on MacOS and Linux
Introduction to Vim: http://blog.interlinked.org/tutorials/vim_tutorial.html
curl https://raw.github.com/srushti/vim-get/master/install.sh -o - | sh
If you want to add another plugin, just edit the plugins.yml file and add the name & url of the source control of the plugin.
The leader is mapped to
Esc is mapped to
In Normal mode (
,w - Save all buffers and place the cursor back to sameplace.
,W - Save all buffers and place the cursor back to sameplace.
,n - File browser (NerdTree Toggle)
,/ - File browser (NERDTree Find)
Space - Page Down
Shift + Space - Page Down
Ctrl + Shift + Right - Goto Next buffer
Ctrl + Shift + Left - Goto Previous buffer
,a - Search in files (Ack)
,f - Search open buffers (Fuzzy Finder like Textmate)
,d - close buffer
,D - close all buffers
,u - GUI Undo history (GUndo) (Needs Python version more than 2.4v)
,, - Toggle between last two buffers
,ew - Open/Edit file in the current directory
,es - Open/Edit file in HORIZONTAL SPLIT
,ev - Open/Edit file in VERTICAL SPLIT
,et - Open/Edit file in NEW TAB
Execute Ruby Specs
,s - Run one spec under the cursor
,S - Run all specs in the current file
,- - Rerun last rake command (most likely the last run spec)
In Insert mode (
jj - Back to normal mode(or ESC) #
uu - Replaces with the charecter
hh - Replaces with the charecter
aa - Replaces with the charecter
<tab> - auto complete or expand snippet
.vimrc for more.
F5 Executes the current file.
So many good stuff - get to know this plugin!
,m - Jump to model
,v - Jump to view
,c - Jump to controller
Test Ruby Specs
,s - Performs
.Rake from rails plugin => normal
,S - Performs
Rake from rails plugin => normal
,- - Perform
Rake - from rails plugin => normal
`:CoffeeCompile watch` show compiled js in split
Provides text-objects for Ruby blocks
`var` (visual around Ruby) `vir` (visual inner Ruby) `ar` / `ir` (expand/contract selection) `cir` (change inner Ruby) `dar` (delete around Ruby)
Expand CSS selectors
div.event in to markup
,gd - Git diff
,gs - Git status press
- to stage file
,gw - Git write
,ga - Git add
,gb - Git blame
,gco - Git checkout
,gci - Git commit
,gm - Git move
,gr - Git remove
snippets usage (
TAB to expand
Examples (in a Ruby file):
Navigate changes history tree
Note you can also drop back to the terminal using Ctrl+Z, to get
back to Vim with
%1. This is not a feature of Conque.
Shows history of yanked (copied) text
ctrl + p will also cycle through paste history
Search project for text (aka find in files)
,a "some words"
Project file browser
,n opens file browser
x open and close files/folders
m menu to move/delete/copy files/folders
I use nerdtree for creating or moving files, but find command-t quicker for opening files.
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
ds - delete surrounding
Install these vimfiles manually
Note: You will already have a
~/.vim folder, either delete or move it.
cp -r ~/.vim ~/.vim.old 2>/dev/null rm -fr ~/.vim 2>/dev/null rm -f ~/.vimrc 2>/dev/null git clone https://github.com/srushti/vim-get.git ~/.vim && cd ~/.vim && rake update
curl https://raw.github.com/ravidsrk/vim-get/master/install.sh -o - | sh
To update to the latest vimfiles
cd ~/.vim rake preinstall
brew install ack brew install ctags
Note: MacOS comes with the BSD version of ctags which is not compatible.
sudo apt-get install exuberant-ctags sudo apt-get install ack-grep sudo ln -s /usr/bin/ack-grep /usr/local/bin/ack