1

When updating vundle-managed plugins with: :PluginUpdate in buffer, I get the following error message:

Error detected while processing
~/.vim/bundle/LaTeX-Suite-aka-Vim-LaTeX/plugin/remoteOpen.vim: line 33
E174: Command already exists: add ! to replace it

I have the queasy feeling that I may well have installed this the wrong way. I did:

  • git-cloned LaTeX-Suite-aka-Vim-LaTeX in ~/.vim/bundle/ and then ran :PluginInstall in a vim buffer.

  • added the line: Plugin 'vim-scripts/LaTeX-Suite-aka-Vim-LaTeX'
    between call vundle#begin() and call vundle#end() in my ~/.vimrc and sourced .vimrc,

  • ran :PluginUpdate in buffer

Can someone please help me with this issue?

  • I was under the impression that you didnt need to git clone if using Vundle? Never used it, but... – D. Ben Knoble Oct 22 '18 at 20:59
  • @D.BenKnoble: you are right of course, the point being in that particular trivial case, that I actually did NOT know whether the two plugins (the one on GitHub and the other one available through Vundle) were one and the same. So I tried both and it turns out in that case that importing through the Vundle facility with :InstallPlugin or through a regelrecht $ git clone ... cmd in terminal gives you rigorously the same result. In fact the issue had nothing to do with that. As pointed out in the answer one of the plugin's internals needs a little bit of dusting.... – Cbhihe Oct 23 '18 at 6:49
2

When you read the error message you can see that the problem comes from ~/.vim/bundle/LaTeX-Suite-aka-Vim-LaTeX/plugin/remoteOpen.vim on line 33. This line is the following:

com -nargs=1 RemoteOpen :call RemoteOpen('<args>')

It uses :h :command to create the user defined command :RemoteOpen.

What Vim says is Command already exists: add ! to replace it. It says that because when you do :PluginUpdate the plugin is sourced again and as :h E174 says:

:com[mand][!] [{attr}...] {cmd} {rep}
            Define a user command.  The name of the command is
            {cmd} and its replacement text is {rep}.  The command's
            attributes (see below) are {attr}.  If the command
            already exists, an error is reported, unless a ! is
            specified, in which case the command is redefined.

So an easy fix for you is to replace the line by

com! -nargs=1 RemoteOpen :call RemoteOpen('<args>')

Also maybe it would be worth it to contact the mainteners and see if they can fix that.

  • +1. Thanks, in particular (but not only) because I had not realized that one could parse the help docs for error codes, e.g. :h E174. Quite useful. + Already contacted plugin's maintainers about the software vagaries in question... – Cbhihe Oct 22 '18 at 18:01
  • 1
    @Cbhihe Then you might also want to read this question about how to use the doc :) – statox Oct 23 '18 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.