当我打开 vim 编辑器时,我目前收到以下错误。
Error detected while processing function vundle#config#bundle[2]..<SNR>33_check_bundle_name:
line 1:
E121: Undefined variable: s:bundle_names
E116: Invalid arguments for function has_key(s:bundle_names, a:bundle.name)
line 11:
E121: Undefined variable: s:bundle_names
Press ENTER or type command to continue
从研究来看,这似乎来自两个相互冲突的捆绑。但是很难确定此错误来自哪个插件,因为似乎我只使用 Vundle。 https://github.com/VundleVim/Vundle.vim/issues/682
当我运行BundleInstall
时,我打开了以下文件:
" Installing plugins to /Users/staguilar/.vim/bundle
Plugin 'VundleVim/Vundle.vim'
Helptags
不确定错误是否来自此插件。这是我.vimrc
文件。
let mapleader = " "
set backspace=2 " Backspace deletes like most programs in insert mode
set nobackup
set nowritebackup
set noswapfile " http://robots.thoughtbot.com/post/18739402579/global-gitignore#comment-458413287
set history=50
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set laststatus=2 " Always display the status line
set autowrite " Automatically :write before running commands
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if (&t_Co > 2 || has("gui_running")) && !exists("syntax_on")
syntax on
endif
if filereadable(expand("~/.vimrc.bundles"))
source ~/.vimrc.bundles
endif
" Wrap commit message to 72 characters
filetype indent plugin on
autocmd FileType gitcommit set textwidth=72
" Set spellfile to location that is guaranteed to exist, can be symlinked to
" Dropbox or kept in Git and managed outside of thoughtbot/dotfiles using rcm.
set spellfile=$HOME/.vim-spell-en.utf-8.add
" Autocomplete with dictionary words when spell check is on
set complete+=kspell
" Always use vertical diffs
set diffopt+=vertical
" Local config
if filereadable($HOME . "/.vimrc.local")
source ~/.vimrc.local
endif
这是.vimrc.bundles
文件。
if &compatible
set nocompatible
end
" Remove declared plugins
function! s:UnPlug(plug_name)
if has_key(g:plugs, a:plug_name)
call remove(g:plugs, a:plug_name)
endif
endfunction
command! -nargs=1 UnPlug call s:UnPlug(<args>)
let g:has_async = v:version >= 800 || has('nvim')
call plug#begin('~/.vim/bundle')
" Define bundles via Github repos
Plug 'christoomey/vim-run-interactive'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'elixir-lang/vim-elixir'
Plug 'fatih/vim-go'
Plug 'janko-m/vim-test'
Plug 'kchmck/vim-coffee-script'
Plug 'pangloss/vim-javascript'
Plug 'pbrisbin/vim-mkdir'
Plug 'slim-template/vim-slim'
Plug 'tpope/vim-bundler'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-projectionist'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-rake'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-rhubarb'
Plug 'tpope/vim-surround'
Plug 'vim-ruby/vim-ruby'
Plug 'vim-scripts/tComment'
Plug 'Shougo/vimproc.vim', {'do' : 'make'}
Plug 'https://github.com/scrooloose/nerdtree.git'
Plug '/usr/local/opt/fzf'
Plug 'mustache/vim-mustache-handlebars'
if g:has_async
Plug 'w0rp/ale'
endif
if filereadable(expand('~/.vimrc.bundles.local'))
source ~/.vimrc.bundles.local
endif
call plug#end()
查看您的vimrc.bundles.local
文件并将其与vimrc.bundles
文件进行比较。查看您是否发现两个文件中都出现了任何插件,如果找到它,请将其从其中一个文件中删除。