VIM错误e492-不是编辑命令:PluginInstall



我正在尝试在MacVim上安装Vundle。我遵循以下链接获取vundle。我还配置了.vimrc文件。但是,当我尝试插件时,我会收到以下错误。

E492: Not an editor command: PluginInstall

my .vimrc包含以下内容:

  1 set nocompatible    "https://stackoverflow.com/questions/5845557/in-a-vimrc-is-set-nocc
    ompatible-completely-useless
  2
  3 " https://github.com/gmarik/Vundle.vim
  4 filetype off                  " required
  5
  6 " set the runtime path to include Vundle and initialize
  7 set rtp+=~/.vim/bundle/Vundle.vim
  8 call vundle#begin()
  9 " alternatively, pass a path where Vundle should install plugins
 10 "call vundle#begin('~/some/path/here')
 11
 12 " let Vundle manage Vundle, required
 13 Plugin 'gmarik/Vundle.vim'
 14
 15 " All of your Plugins must be added before the following line
 16 call vundle#end()            " required
 17 filetype plugin indent on    " required

我的vim目录:

Username-MacBook-Pro:bundle u1$ pwd
/Users/u1/.vim/bundle
Username-MacBook-Pro:bundle u1$ ls
Vundle.vim

我还检查了此Stackoverflow帖子。但这并不能解决我的问题。为什么会丢下这样的错误,我该如何找到我的问题。

我必须将vundle安装到插件目录中而不是捆绑包中。它解决了问题。

git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/plugin/Vundle.vim

您可以检查:版本

的输出
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"

注意您正在使用哪个VIMRC文件,例如您正在配置$HOME/vimrc,但是VIM正在读取$HOME/.vimrc(在文件名中没有点)

这发生在我身上。

希望这对您有帮助。

如下所述,我需要这样设置vundle:

$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

之后,错误解决了。顺便说一句,我在FreeBSD 10.3稳定的机器上,而不是MacOS

这可能是线字符的结尾,Windows的CRLF和LINUX的LF。
更改您的线路结尾。
如果在 ~/.vimrc文件中的unix上:

:set fileformat=unix :w

最新更新