Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 31 lines (24 sloc) 646 Bytes
#! /bin/sh
# Use existing vim sessions to open new files, if at all possible. This is a
# much nicer way to work than heaps of gvim windows, opening everything with :e
# or having to manual specify all the --remote stuff.
SERVERNAME=GVIM
base=${0##*/}
editor=${base%-client}
# If it looks like we're passing in options, just call the editor directly.
if [ "${1::1}" == "-" ]
then
exec ${editor} $@
fi
if [ "${editor}" == "vim" ]
then
flags="--remote-wait"
else
flags="--remote"
fi
if $(${editor} --serverlist | grep -q ${SERVERNAME})
then
exec ${editor} --servername ${SERVERNAME} ${flags} $@
else
exec ${editor} $@
fi