v, a Vim command line wrapper
v to help with a couple of my common wants when starting Vim. It’s a script written in Ruby and the source is on GitHub, here are the two things it does.
v is passed an argument matching
path/to/file:line-number it will load the file and place the cursor on the specified line, this allows you to easily copy/paste output from tools such as RSpec and start editing in the correct place.
v is run with no arguments it looks in the current directory for a file called
Session.vim and loads it as a Vim session. Note that this only occurs when no arguments are passed, so you can load other specified files without spoiling your session.
To see what
v will execute for the given arguments add
$ v --dry-run ./spec/path/to/failure_spec.rb:123 vim ./spec/path/to/failure_spec.rb +123
What command line script would be complete without corresponding help? Run
v --help for usage.