Loading .vim/bin/vim.remote +27 −10 Original line number Diff line number Diff line Loading @@ -3,18 +3,35 @@ set -eu . ~/.shell/funcs for ed in nvim vim; do has $ed && break done WAIT_EXPR='tabmove -1 | setl bufhidden=wipe' # 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' "$@" vim_version() { printf '%03i%03i' ` vim --version | sed -n '1{s/[^0-9]*\([0-9]\{1,\}\)\.\([0-9]\{1,\}\).*/\1 \2/p;}'` } if has vim && [ `vim_version` -ge 008000 ]; then if [ -n "${NVIM_LISTEN_ADDRESS-}" ] && [ -z "${FROM_ALIAS-}" ]; then set vim --remote-wait-silent "+${WAIT_EXPR}" "$@" else set vim --remote-silent "$@" fi elif has nvim && has nvr; then if [ -n "${NVIM_LISTEN_ADDRESS-}" ] && [ -z "${FROM_ALIAS-}" ]; then set nvr -s --remote-tab-wait -c "${WAIT_EXPR}" "$@" else set nvr -s --remote "$@" fi elif has vim; then set vim "$@" elif has nvim; then set nvim "$@" elif has vi; then set vi "$@" else set $ed "$@" echo >&2 "No vim-like editor found" exit 3 fi unset FROM_ALIAS Loading Loading
.vim/bin/vim.remote +27 −10 Original line number Diff line number Diff line Loading @@ -3,18 +3,35 @@ set -eu . ~/.shell/funcs for ed in nvim vim; do has $ed && break done WAIT_EXPR='tabmove -1 | setl bufhidden=wipe' # 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' "$@" vim_version() { printf '%03i%03i' ` vim --version | sed -n '1{s/[^0-9]*\([0-9]\{1,\}\)\.\([0-9]\{1,\}\).*/\1 \2/p;}'` } if has vim && [ `vim_version` -ge 008000 ]; then if [ -n "${NVIM_LISTEN_ADDRESS-}" ] && [ -z "${FROM_ALIAS-}" ]; then set vim --remote-wait-silent "+${WAIT_EXPR}" "$@" else set vim --remote-silent "$@" fi elif has nvim && has nvr; then if [ -n "${NVIM_LISTEN_ADDRESS-}" ] && [ -z "${FROM_ALIAS-}" ]; then set nvr -s --remote-tab-wait -c "${WAIT_EXPR}" "$@" else set nvr -s --remote "$@" fi elif has vim; then set vim "$@" elif has nvim; then set nvim "$@" elif has vi; then set vi "$@" else set $ed "$@" echo >&2 "No vim-like editor found" exit 3 fi unset FROM_ALIAS Loading