Skip to content

Instantly share code, notes, and snippets.

@momorientes
Created October 8, 2015 14:14
Show Gist options
  • Save momorientes/8ea5fad7b596e0a0567e to your computer and use it in GitHub Desktop.
Save momorientes/8ea5fad7b596e0a0567e to your computer and use it in GitHub Desktop.
vim:15 opens document with vim at line 15
vim() {
if test $# != 1 -o -r $1; then
command vim "${@}"
else
local args
args=(${(s.:.)1})
[[ $#args -ge 2 && $args[2] == <-> ]] \
&& command vim $args[1] +$args[2] \
|| command vim $args[1]
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment