# # See README.md # # Derek Wyatt (derek@{myfirstnamemylastname}.org # function callvim { if [[ $# == 0 ]]; then cat <, append it [[ ${after} = :* && ${after} != *\ ]] && after+="" [[ ${before} = :* && ${before} != *\ ]] && before+="" # Open files passed (:A means abs path resolving symlinks, :q means quoting special chars) [[ $# -gt 0 ]] && files=':args! '"${@:A:q}" # Pass the built vim command to gvim cmd="$before$files$after" # Run the gvim command gvim --servername "$name" --remote-send "$cmd" || return $? # Run postCallVim if defined (maybe to bring focus to gvim, see README) (( ! $+functions[postCallVim] )) || postCallVim } alias v=callvim alias vvsp="callvim -b':vsp'" alias vhsp="callvim -b':sp'" alias vk="callvim -b':wincmd k'" alias vj="callvim -b':wincmd j'" alias vl="callvim -b':wincmd l'" alias vh="callvim -b':wincmd h'"