aliases/vim: simplify code flow

pull/1960/head
John D Pell 2021-09-22 13:21:16 -07:00
parent 8c697715eb
commit 6e2e945771
1 changed files with 8 additions and 14 deletions

View File

@ -2,20 +2,14 @@
cite 'about-alias' cite 'about-alias'
about-alias 'vim abbreviations' about-alias 'vim abbreviations'
if _command_exists vim; then _command_exists vim || return
alias v='$VIM'
# open the vim help in fullscreen incorporated from alias v='vim'
# https://stackoverflow.com/a/4687513 # open the vim help in fullscreen incorporated from
alias vimh='${VIM} -c ":h | only"' # https://stackoverflow.com/a/4687513
fi alias vimh='vim -c ":h | only"'
# open vim in new tab is taken from # open vim in new tab is taken from
# http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek # http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek
case $OSTYPE in _command_exists mvim && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; }
darwin*) _command_exists gvim && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; }
_command_exists mvim && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; }
;;
*)
_command_exists gvim && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; }
;;
esac