Vundle 安装失败?

Vundle 安装失败?

我正在尝试按照以下说明安装 Vundle这里,但是当我使用命令时,vim +PluginInstall +qall 终端显示以下内容:

Error detected while processing /home/scorpion/.vimrc:
line    6:
E117: Unknown function: vundle#begin
line   11:
E492: Not an editor command: Plugin 'VundleVim/Vundle.vim'
line   16:
E492: Not an editor command: Plugin 'tpope/vim-fugitive'
line   18:
E492: Not an editor command: Plugin 'L9'
line   20:
E492: Not an editor command: Plugin 'git://git.wincent.com/command-t.git'
line   22:
E492: Not an editor command: Plugin 'file:///home/gmarik/path/to/plugin'
line   25:
E492: Not an editor command: Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
line   28:
E492: Not an editor command: Plugin 'ascenator/L9', {'name': 'newL9'}
line   31:
E117: Unknown function: vundle#end
Press ENTER or type command to continue

我是新手。这里可能存在什么问题?我该如何解决?
我如何确保我的 Vundle 安装正确?

的内容.vimrc

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/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
Plugin 'ascenator/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

答案1

从我的互动来看,~/.vim/bundle/Vundle.vim尚未设置。因此,以下是设置步骤维姆

  1. 创造/home/$USER/.vim/bundle

    mkdir -p /home/$USER/.vim/bundle
    
  2. 将 git 存储库克隆到 bundle 目录中:

    git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    
  3. .vimrc如果没有的话现在创建一个文件:

    touch /home/$USER/.vimrc
    
  4. 添加以下几行:

    " no vi compat
    set nocompatible
    
    " filetype func off
    filetype off
    
    " initialize vundle
    set rtp+=~/.vim/bundle/Vundle.vim
    
    call vundle#begin()
    " start- all plugins below
    
    Plugin 'VundleVim/Vundle.vim'
    Plugin 'mattn/emmet-vim'        
    Plugin 'morhetz/gruvbox'
    Plugin 'itchyny/lightline.vim'
    Plugin 'scrooloose/nerdtree.git'
    Plugin 'davidhalter/jedi-vim'
    Plugin 'pangloss/vim-javascript'
    Plugin 'groenewege/vim-less'
    Plugin 'taglist.vim'
    Plugin 'elzr/vim-json'
    Plugin 'airblade/vim-gitgutter' " http://vimawesome.com/plugin/vim-gutter
    Plugin 'wincent/command-t'      " fast buffer browser
    
    " stop - all plugins above
    call vundle#end()
    
    
    " filetype func on
    filetype plugin indent on
    
  5. vim +PluginInstall +qall现在从终端或内部运行vim:PluginInstall

注意:这些是开始工作所需的基本配置VundleVim,我添加了自己的插件,您需要添加自己的插件。从获取更多插件这里

来源:

https://github.com/VundleVim/Vundle.vim

相关内容