summaryrefslogtreecommitdiff
path: root/tvim
blob: 63f5b16260c423c63154c28d960bb31c8f3e28e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/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