Improve vimw function

This commit is contained in:
tosu 2024-06-19 02:34:11 +02:00
parent 190b1a3a33
commit d44813e192
1 changed files with 4 additions and 2 deletions

View File

@ -124,8 +124,10 @@ function cd () {
}
function vimw () {
[ $# = 1 ] || { echo "Usage: vimw FILE"; return 1; }
vim $(type -P "$1")
[ -z "$1" ] && { echo "Usage: vimw FILE [VIM_ARGS...]"; return 1; }
first="$1"
shift
vim "$@" $(type -P "$first")
}
complete -F _command vimw