vscripts/tvim

15 lines
407 B
Text
Raw Normal View History

#!/usr/bin/env bash
typeset -a vimopt=(
'--cmd' 'let g:tvim = 1'
)
error() {
echo "$*" >&2
exit 1
}
2018-07-17 18:46:59 +03:00
termbin=$(command -v default-terminal-emulator) || termbin=$(command -v xterm) || error "No terminal found!"
2020-02-11 14:10:03 +02:00
vimbin=$(command -v nvim) || vimbin=$(command -v vim) || vimbin=$(command -v vi) || error "No vim binary found!"
2020-02-11 14:10:03 +02:00
exec "$termbin" -e "$vimbin" "${vimopt[@]}" "$@" &>/dev/null & disown