From d6119b43f54c53d3fdffd995699337b100eee2c0 Mon Sep 17 00:00:00 2001 From: rhatto Date: Thu, 27 Mar 2014 22:03:39 -0300 Subject: Avoid viminfo if VIM is set as $EDITOR (#50) --- lib/keyringer/functions | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/keyringer/functions') diff --git a/lib/keyringer/functions b/lib/keyringer/functions index f1af951..af300ef 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -284,6 +284,13 @@ function keyringer_set_env { fi fi + # Avoid viminfo, see https://keyringer.pw/trac/ticket/50 + if $EDITOR --help | grep -q -e "^VIM"; then + if ! echo $EDITOR | grep -q -- "-i NONE"; then + EDITOR="$EDITOR -i NONE" + fi + fi + if [ ! -f "$OPTIONS" ]; then echo "No option config was found" exit 1 -- cgit v1.2.3