From 077edf58e5cac0ce9d99fc39c7ce6a6d2e19cb1d Mon Sep 17 00:00:00 2001 From: Tomas Baca Date: Sat, 11 Aug 2018 13:20:16 +0200 Subject: [PATCH 1/2] added neovim support --- vims | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/vims b/vims index d5f0b19..41fd001 100755 --- a/vims +++ b/vims @@ -49,5 +49,14 @@ if [ "$DISABLE_VIMRC" -eq "1" ]; then vim_cmds=(-u NONE "${vim_cmds[@]}") fi -vim - -nes "${vim_cmds[@]}" -c ':q!' | tail -n +2 - +# locate the vim/nvim binaries +VIM_BIN="$(whereis -b vim | awk '{print $2}')" +NVIM_BIN="$(whereis -b nvim | awk '{print $2}')" + +if [ -x "$NVIM_BIN" ]; then + ${NVIM_BIN} - -nes "${vim_cmds[@]}" -c ':q!' +elif [ -x "$VIM_BIN" ]; then + ${VIM_BIN} - -nes "${vim_cmds[@]}" -c ':q!' | tail -n +2 +else + echo "Nor vim and nvim are installed!" +fi From 0083c411e6259a4a7311dbdee10883142ed3ae93 Mon Sep 17 00:00:00 2001 From: Miles Cranmer Date: Sat, 11 Aug 2018 21:26:52 -0400 Subject: [PATCH 2/2] Correct grammar in error message --- vims | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vims b/vims index 41fd001..107f2ae 100755 --- a/vims +++ b/vims @@ -58,5 +58,5 @@ if [ -x "$NVIM_BIN" ]; then elif [ -x "$VIM_BIN" ]; then ${VIM_BIN} - -nes "${vim_cmds[@]}" -c ':q!' | tail -n +2 else - echo "Nor vim and nvim are installed!" + echo "Neither vim nor nvim are installed!" fi