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 three 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 or Git grep 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.
Automatically read from
v detects that it's receiving
stdin it will automatically read the content so you never have to forget to pass the
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.
Outputs the version of this script and forwards the command to