Skip to content

Commit 6e2e945

Browse files
committed
aliases/vim: simplify code flow
1 parent 8c69771 commit 6e2e945

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

aliases/available/vim.aliases.bash

+8-14
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,14 @@
22
cite 'about-alias'
33
about-alias 'vim abbreviations'
44

5-
if _command_exists vim; then
6-
alias v='$VIM'
7-
# open the vim help in fullscreen incorporated from
8-
# https://stackoverflow.com/a/4687513
9-
alias vimh='${VIM} -c ":h | only"'
10-
fi
5+
_command_exists vim || return
6+
7+
alias v='vim'
8+
# open the vim help in fullscreen incorporated from
9+
# https://stackoverflow.com/a/4687513
10+
alias vimh='vim -c ":h | only"'
1111

1212
# open vim in new tab is taken from
1313
# http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek
14-
case $OSTYPE in
15-
darwin*)
16-
_command_exists mvim && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; }
17-
;;
18-
*)
19-
_command_exists gvim && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; }
20-
;;
21-
esac
14+
_command_exists mvim && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; }
15+
_command_exists gvim && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; }

0 commit comments

Comments
 (0)