*nohtml*

local/bin/gvim

   1 #!/bin/bash
   2 
   3 vi=($(type -ap gvim | grep -v $0))
   4 at=($(echo $(< ~/.vim/vimpid) gvim))
   5 ls=$($vi --serverlist | grep -i $at)
   6 
   7 [[ $1 == -f ]] && shift
   8 [[ $# > 1 || $ls ]] && rt=-tab
   9 
  10 $vi --servername $at ${@:+--remote$rt-silent "$@"}