summaryrefslogtreecommitdiff
path: root/plugins/vim-interaction
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2019-05-08 20:40:36 +0200
committerGitHub <noreply@github.com>2019-05-08 20:40:36 +0200
commit0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534 (patch)
tree946d9f8b758ebdd63da96152ca56b154c99068da /plugins/vim-interaction
parentafb028763cf40fc339e49011b2cba124dc108fcb (diff)
parentebc700be9b2fa7ae770a644093a5c46a8e323726 (diff)
downloadzsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.tar.gz
zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.tar.bz2
zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.zip
Merge branch 'master' into master
Diffstat (limited to 'plugins/vim-interaction')
-rw-r--r--plugins/vim-interaction/vim-interaction.plugin.zsh10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/vim-interaction/vim-interaction.plugin.zsh b/plugins/vim-interaction/vim-interaction.plugin.zsh
index b774be342..010f998d3 100644
--- a/plugins/vim-interaction/vim-interaction.plugin.zsh
+++ b/plugins/vim-interaction/vim-interaction.plugin.zsh
@@ -8,10 +8,11 @@ function callvim
{
if [[ $# == 0 ]]; then
cat <<EOH
-usage: callvim [-b cmd] [-a cmd] [file ... fileN]
+usage: callvim [-b cmd] [-a cmd] [-n name] [file ... fileN]
-b cmd Run this command in GVIM before editing the first file
-a cmd Run this command in GVIM after editing the first file
+ -n name Name of the GVIM server to connect to
file The file to edit
... fileN The other files to add to the argslist
EOH
@@ -21,13 +22,16 @@ EOH
local cmd=""
local before="<esc>"
local after=""
- while getopts ":b:a:" option
+ local name="GVIM"
+ while getopts ":b:a:n:" option
do
case $option in
a) after="$OPTARG"
;;
b) before="$OPTARG"
;;
+ n) name="$OPTARG"
+ ;;
esac
done
shift $((OPTIND-1))
@@ -43,7 +47,7 @@ EOH
files=':args! '"${@:A:q}<cr>"
fi
cmd="$before$files$after"
- gvim --remote-send "$cmd"
+ gvim --servername "$name" --remote-send "$cmd"
if typeset -f postCallVim > /dev/null; then
postCallVim
fi