Skip to content

Opinionated sets of VIM plugins and configuration for Ruby on Rails development

Notifications You must be signed in to change notification settings

adiel/vim-on-rails

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VIM on Rails

VIM on Rails is an opinionated sets of VIM plugins, colorschemes, settings and shortcuts design for Ruby on Rails development. It's a work in progress and I will add features along the way.

I will try to document possible scenarios developers found themselves when writing Ruby on Rails code. For each scenario I'll list the way I've solved it.

Installation

gem install exuberant_ctags ri_vim
git clone https://github.com/soulnafein/vim-on-rails.git
cd vim-on-rails
rake install

This will take care of your existing .vim folder and .vimrc .gvimrc files You can restore your previous VIM environment by typing:

rake uninstall

Use cases

Editing

Common developers editing needs. I will assume a basic knowledge of VIM modes, movement commands and so on.

Move one or more lines up or down the file

CTRL + UP or CTRL + DOWN moves one line. Selects more than one line in visual mode to move them up as well (e.g. SHIFT+V)

Move a whole method definition up and down

TODO

Quickly saving a file

Just press CTRL+S baby! Because :w is just awkward. I might actually try to implement the autosave file when it loses focus like in RubyMine

Press CTRL+ALT+S to save all buffers (e.g. :wall)

Code completion (based on word in the file)

CTRL + SPACE

Jump to method or class in current file

Not sure yet about the shortcut yet. The command is :FufBufferTagAll and it's provided by FuzzyFinder plugin

Surround current visual selection with double quotes

I have to use surround.vim plugin but I'm not sure how yet

Jump to definition of current cursor element

Not available yet.

Open file in current window

Open a file by using FuzzyFinder

CTRL+SHIFT+N

Switch to currently open buffer

Again thank you FuzzyFinder ALT+SHIFT+N

Open file in the same folder as current one

,e and type the name of the file and enter

Window splits

Split vertically

CTRL+W, v

Split horizontally

CTRL+W, n

Move between windows

CTRL+W, direction where direction is one of h,j,k,l

Enlarge current window (ZoomWin plugin)

,, and the same again to zoom out

Debugging

Not implemented yet

About

Opinionated sets of VIM plugins and configuration for Ruby on Rails development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 76.3%
  • Ruby 23.7%