我在 Vim 上编写 c++ 时得到了"Error detected while processing ~/vimrc"



我想在 vim 上使用 c++,但我收到 vimrc 错误

" use vim settings, rather than vi settings. this setting must be as
early as
" possible, as it has side effects. this is required for vundle.
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" add other plugins here...
Plugin 'jamessan/vim-gnupg'
Bundle 'croaky/vim-colors-github'
" All of your Plugins must be added before the following line
call vundle#end()               " required
filetype plugin indent on       " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
~                    
$ vim ~/.vimrc
Error detected while processing /home/tridip/.vimrc:
line    2:
E492: Not an editor command: early as
line    9:
E117: Unknown function: vundle#begin
line   12:
E492: Not an editor command: Plugin 'gmarik/Vundle.vim'
line   15:
E492: Not an editor command: Plugin 'jamessan/vim-gnupg'
line   16:
E492: Not an editor command: Bundle 'croaky/vim-colors-github'
line   19:
E117: Unknown function: vundle#end
Press ENTER or type command to continue
Error detected while processing /home/tridip/.vimrc:
line    2:
E492: Not an editor command: early as

看起来您已经将一些文本粘贴到.vimrc并且存在不需要的换行符,因此该文本应该是前一行的一部分,因此该文本位于其自己的行上:

early as

这不是一个有效的 vim 命令,因此会导致错误。

打开.vimrc,在第 2 行添加一个"字符,或者转到第 1 行并按J连接行。

line    9:
E117: Unknown function: vundle#begin

这表明 vundle 文件未安装在~/.vim/bundle/Vundle.vim中 - 如果您想使用这些文件,则需要安装它们!

相关内容