Skip to content

Instantly share code, notes, and snippets.

Last active Jun 25, 2021
What would you like to do?
Work with terminal application to open target file via vim
# From by StingyKarmaWhore and u/yramagicman (upstream
# Modifed by haxpor: auto read from external changes, getting rid of line, and properly target an existing file on server
[ -n "$1" ] && server=$1
[ -n "$2" ] && file=$2
serverlist=`echo $(vim --serverlist)`
echo ${serverlist,,}
if [[ ${serverlist,,} == *"${server,,}"* ]]; then
vim +'set autoread|au CursorHold * checktime' --servername $server --remote-tab-silent $file
vim +'set autoread|au CursorHold * checktime' --servername $server $file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment