Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug#497663: Tab completion for vim is broken



Clint Adams <schizo@xxxxxxxxxx>:
> On Thu, Sep 04, 2008 at 12:05:05PM +0300, Arto Jantunen wrote:
> > >> Typing vim and pressing tab produces the following output:
> > >> 
> > >> _vim:31: unmatched '
> > >> 
> > >> Commenting out lines 31-40 in
> > >> /usr/share/zsh/functions/Completion/Unix/_vim fixes the problem. Should
> > >> be trivial to fix properly for someone who understands zsh's compeltion
> > >> syntax (I don't).
> > >
> > > I can't reproduce this and I don't see what the problem might be.
> > > Is this consistent for you?
> > 
> > Hmm. Apparently it depends on "emulate csh" being used. I can't
> > reproduce with a .zshrc of only
> > 
> > autoload -U compinit
> > compinit
> > 
> > But can after adding emulate csh above those lines.
> 
> Anyone know which option might be the culprit here?


This does the trick:

diff --git a/Completion/Unix/Command/_vim b/Completion/Unix/Command/_vim
index 684e027..da9295b 100644
--- a/Completion/Unix/Command/_vim
+++ b/Completion/Unix/Command/_vim
@@ -28,15 +31,15 @@ arguments=(
   '-C[make vim compatible with vi]'
   '-N[do not force compatibility with vi]'
   '(--nofork -f)'{--nofork,-f}'[do not detach the GUI version from the shell]'
-  '-V-[verbosity level]::verbosity:((0\:"do not display any messages"
-                                     1\:"display when viminfo file is read or written"
-                                     2\:"display sourced files"
-                                     5\:"display every searched tag-file"
-                                     8\:"display files that trigger autocommands"
-                                     9\:"display every triggered autocommand (default)"
-                                    12\:"display every executed function"
-                                    13\:"report every thrown, caught, finished, or discarded exception"
-                                    14\:"display anything pending in a \:finally clause"
+  '-V-[verbosity level]::verbosity:((0\:"do not display any messages" \
+                                     1\:"display when viminfo file is read or written" \
+                                     2\:"display sourced files" \
+                                     5\:"display every searched tag-file" \
+                                     8\:"display files that trigger autocommands" \
+                                     9\:"display every triggered autocommand (default)" \
+                                    12\:"display every executed function" \
+                                    13\:"report every thrown, caught, finished, or discarded exception" \
+                                    14\:"display anything pending in a \:finally clause" \
                                     15\:"display every executed ex-command"))'
   '-D[debugging mode]'
   '-n[no swap file (memory only)]'


But I don't understand, why this is not enough:

diff --git a/Completion/Unix/Command/_vim b/Completion/Unix/Command/_vim
index 684e027..44a317d 100644
--- a/Completion/Unix/Command/_vim
+++ b/Completion/Unix/Command/_vim
@@ -1,5 +1,7 @@
 #compdef vim exim gvim gex gview rvim rview rgvim rgview evim eview vimdiff gvimdiff
 
+emulate -L zsh
+
 (( $+functions[_vim_files] )) ||
 _vim_files () {
   case $PREFIX in

Regards, Frank



Messages sorted by: Reverse Date, Date, Thread, Author