Commit 65a875ef authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Always alias vim to the nvim/vim wrap script

parent f595bdfd
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -7,14 +7,7 @@ export WORKON_HOME=~/.virtualenvs
export FIGNORE='.o:.pyc:~:.swp:.swa'
export VIRTUAL_ENV_DISABLE_PROMPT=yes
export GIT_SSH=$HOME/.ssh/ssh

if has nvr; then
export EDITOR="$HOME/.vim/bin/vim.remote"
elif has vim; then
	export EDITOR=vim
else
	export EDITOR=vi
fi

has gpg-agent &&
	export SSH_AUTH_SOCK=`gpgconf --list-dirs agent-ssh-socket`
+18 −7
Original line number Diff line number Diff line
#!/bin/sh
if ! type nvr >/dev/null 2>&1 || [ -z "$NVIM_LISTEN_ADDRESS" ]; then
	unset FROM_ALIAS
	exec vim "$@"
elif [ -n "$FROM_ALIAS" ]; then
	unset FROM_ALIAS
	exec nvr -s --remote "$@"
set -eu

. ~/.shell/funcs

for ed in nvim vim; do
	has $ed && break
done

# Outside of an nvim context use vim even if nvr is available
if [ -n "${NVIM_LISTEN_ADDRESS-}" ] && has nvr; then
	test -n "${FROM_ALIAS-}" &&
		set nvr -s --remote "$@" ||
		set nvr -s --remote-tab-wait \
			-c 'tabmove -1 | setl bufhidden=wipe' "$@"
else
	exec nvr -s --remote-tab-wait -c 'tabmove -1 | setl bufhidden=wipe' "$@"
	set $ed "$@"
fi

unset FROM_ALIAS
exec "$@"