2016-12-20 10:55:40 +02:00
|
|
|
#!/usr/bin/env bash
|
2018-07-06 00:32:25 +03:00
|
|
|
typeset -a vimopt=(
|
|
|
|
'--cmd' 'let g:tvim = 1'
|
2018-07-06 12:09:20 +03:00
|
|
|
'-c' 'set mouse=a'
|
2018-07-06 00:32:25 +03:00
|
|
|
)
|
2016-12-20 10:55:40 +02:00
|
|
|
|
2018-07-06 00:32:25 +03:00
|
|
|
error() {
|
|
|
|
echo "$*" >&2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
termbin=$(command -v st) || termbin=$(command -v xterm) || error "No terminal found!"
|
2018-07-16 15:25:33 +03:00
|
|
|
vimbin=$(command -v nvim) || vimbin=$(command -v vim) || error "No vim binary found!"
|
2018-07-06 00:32:25 +03:00
|
|
|
|
2018-07-06 12:09:20 +03:00
|
|
|
exec "$termbin" -c tvim -e "$vimbin" "${vimopt[@]}" "$@" &>/dev/null & disown
|