我正在尝试安装Vim的插件管理员Vundle,我正在按照信件的指示行事,但要么是真的遗漏了某些东西,要么就是另一种方法我应该使用Github repository上没有提供的。
步骤1.我在终端执行以下操作:git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
步骤2.我进入以下目录,以便编辑我的vimrc文件:
/usr/share/vim
根据Vundle Github的第3步,我要输入以下内容:
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
Plugin 'user/L9', {'name': 'newL9'}
" 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
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
我打开一个新的终端shell,键入Vim
以启动Vim,因此我运行以下命令::PluginInstall
此处我遇到了问题,因为我在输入:PluginInstall
后在Vim中收到此错误
E492: Not an editor command: PluginInstall
我在这里缺少什么?
答案 0 :(得分:2)
将它放在.vimrc的顶部以使用Vundle。
您在/usr/share/vim
中找到的任何内容 不 。该目录是Vim的系统级运行时目录,你没有做任何的业务。
由于您cd
在错误的目录中编辑,因此您在步骤3之后执行的任何操作都将失败。
第三方脚本和自定义脚本将安装在~/.vim/
中。
自定义设置和映射应以~/.vimrc
编写。
如果你希望Vim保持稳定,你需要将/usr/share/vim
恢复到原始状态。