Merge pull request #1960 from gaelicWizard/alias-vim

aliases/vim: simplify code flow
pull/1961/head
Noah Gorny 2021-09-23 13:50:57 +03:00 committed by GitHub
commit d6c4c0cc88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 14 deletions

View File

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