vscripts/tvim
2020-02-11 15:10:03 +03:00

14 lines
407 B
Bash
Executable file

#!/usr/bin/env bash
typeset -a vimopt=(
'--cmd' 'let g:tvim = 1'
)
error() {
echo "$*" >&2
exit 1
}
termbin=$(command -v default-terminal-emulator) || termbin=$(command -v xterm) || error "No terminal found!"
vimbin=$(command -v nvim) || vimbin=$(command -v vim) || vimbin=$(command -v vi) || error "No vim binary found!"
exec "$termbin" -e "$vimbin" "${vimopt[@]}" "$@" &>/dev/null & disown