Created
October 8, 2015 14:14
-
-
Save momorientes/8ea5fad7b596e0a0567e to your computer and use it in GitHub Desktop.
vim:15 opens document with vim at line 15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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