Vund的Vundle不适用于Ubuntu

时间:2012-08-29 13:57:45

标签: plugins vim vim-plugin

我按照此博客http://web.archive.org/web/20120731003342/http://www.charlietanksley.net/philtex/sane-vim-plugin-management

上的说明安装了Vundle

但在尝试运行:BundleInstall时,我收到了VIM错误

E492: Not an editor command: BundleInstall

这是我的tree ~/.vim

/home/max/.vim
└── bundle
    └── vundle
        ├── autoload
        │   ├── vundle
        │   │   ├── config.vim
        │   │   ├── installer.vim
        │   │   └── scripts.vim
        │   └── vundle.vim
        ├── doc
        │   └── vundle.txt
        ├── LICENSE-MIT.txt
        ├── README.md
        └── test
            ├── files
            │   └── test.erl
            ├── minirc.vim
            └── vimrc

同样,当启动VIM时,我会得到一大堆E492这样的

Error detected while processing /home/max/.vimrc:
line    6:
E117: Unknown function: vundle#rc
line   10:
E492: Not an editor command: Bundle 'gmarik/vundle'
line   15:
E492: Not an editor command: Bundle 'tpope/vim-fugitive'
line   16:
E492: Not an editor command: Bundle 'Lokaltog/vim-easymotion'
line   17:
E492: Not an editor command: Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
line   19:
E492: Not an editor command: Bundle 'surround.vim'
line   20:
E492: Not an editor command: Bundle 'snipMate'
line   21:
E492: Not an editor command: Bundle 'tComment'
line   22:
E492: Not an editor command: Bundle 'mru.vim'
line   23:
E492: Not an editor command: Bundle 'The NERD tree'
line   24:
E492: Not an editor command: Bundle 'matchit.zip'
line   25:
E492: Not an editor command: Bundle 'Vimball'
line   26:
E492: Not an editor command: Bundle 'ScrollColors'
line   27:
E492: Not an editor command: Bundle 'L9'
line   28:
E492: Not an editor command: Bundle 'FuzzyFinder'
line   30:
E492: Not an editor command: Bundle 'git://git.wincent.com/command-t.git'

这是我的.vimrc

set nocompatible

filetype off  " required!

set rtp+=~/.vim/vundle.git/ 
call vundle#rc()

" let Vundle manage Vundle
" required! 
Bundle 'gmarik/vundle'

" My Bundles here:
"
" original repos on github
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
" vim-scripts repos
Bundle 'surround.vim'
Bundle 'snipMate'
Bundle 'tComment'
Bundle 'mru.vim'
Bundle 'The NERD tree'
Bundle 'matchit.zip'
Bundle 'Vimball'
Bundle 'ScrollColors'
Bundle 'L9'
Bundle 'FuzzyFinder'
" non github repos
Bundle 'git://git.wincent.com/command-t.git'


" Shortcuts


noremap <C-Up> <C-W>+
noremap <C-Down> <C-W>-
noremap <C-Left> <C-W>>
noremap <C-Right> <C-W><

nnoremap ,v <C-w>v
nnoremap ,h <C-w>s
nnoremap ,, <C-w>w

map <F11> <Esc>:call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)<CR> 
nmap gf <S-g>
nmap f :FufFile <CR>
vmap c gc 
nmap c gcc
nmap tt :tabnew <CR>
nmap tc :tabclose <CR>
nmap ml :MRU <CR>
nmap s :w <CR>
nmap q :q! <CR>
syntax on
set mouse=a "enables mouse

" Selecting different color schemes
map <silent> ,3 :NEXTCOLOR<cr>
map <silent> ,2 :PREVCOLOR<cr>
map <silent> ,1 :SCROLL<cr>

" Directory Set up

set backup "backs up files
set backupdir=$HOME/.vimbackup
set directory=$HOME/.vimswap
set viewdir=$HOME/.vimviews
"
" silent execute '!mkdir -p $HOME/.vimbackup'
" silent execute '!mkdir -p $HOME/.vimswap'
" silent execute '!mkdir -p $HOME/.vimviews'

" au BufWinLeave * silent! mkview "makes vim save view state
" au BufWinEnter * silent! loadview "makes vim load view state

" Appearance

set columns=60

set guifont=Monaco:h11

map <F11> <Esc>:call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)<CR>
map <silent> ,m :e ftp://mitemiu.com/public_html/wp-content/themes/Mitemiu/<CR>
" map <silent> ,c :e ftp://www.caeious.com/public_html/wp-content/themes/caeious/<CR>
map <silent> ,c :e ftp://www.caeious.com/public_html/<CR>


color jellybeans
set tabpagemax=10 "show only 10 tabs
set background=dark

set number

set scrolloff=3 "minimum lines to keep above/below cursor
set foldenable "auto fold code

" Behaviour
" set nowrap "wrap long lines
set linebreak
:filetype plugin indent on  " lets filetype plugins be used

" if bufwinnr(1)
"   map <kPlus><C-W>+
"   map <kMinus><C-W>-  
"   map <kDivide><c-w><
"   map <kMultiply><c-w>>
" endif

set autoindent
set smartindent                                
set tabstop=4
set shiftwidth=4
set smarttab
set expandtab
set softtabstop=4
set spell

set showmatch "shows matching parens, brackets

set winminheight=0

set go-=T "eliminates tool bar in gVim
set go-=m "eliminates menu bar in gVim
set go-=r "eliminates right scroll bar
set lines=50 "50 lines of text instead of 24

set backspace=2 "makes backspace work like normally it does
:fixdel

set vb t_vb= "prevents vim from beeping when command is bad. instead it flashes screen.            

set ruler "shows statusline, displays curor position

set incsearch "vim searches text as you enter it
" set hlsearch "hilights searched items
set ignorecase "case insensitive search
set smartcase "case sensetive when using captials
set wildmenu "shows list instead of completing
set wildmode=list:longest,full "command <TAB> completeiton, lists matches,
set virtualedit=all "lets cursor freely roam anywhere like in command mode

显然Vundle安装不正确。 如何让Vundle工作?

7 个答案:

答案 0 :(得分:29)

Vundle已安装在

~/.vim/bundle/vundle

所以这一行

set rtp+=~/.vim/vundle.git/

应该是

set rtp+=~/.vim/bundle/vundle

~/.vim/vundle.git/

是包含使Git存储库成为Git存储库的所有内容的文件夹的路径。你真的不希望Vim在那里找到可用的脚本。

答案 1 :(得分:7)

我使用git commitcrontab -e

遇到了此问题

这些命令似乎调用vi而不是vim

在我的.bashrc中设置此项

export EDITOR=vim

答案 2 :(得分:2)

我刚刚遇到问题,我在阅读

后解决了这个问题

https://github.com/gmarik/vundle/issues/168

它说。

如果您通过/ usr / bin / vi而不是vim显式调用vi编辑器(以避免任何别名),则可能会发生这种情况。 在我将其配置为使用vim之前,简单的“git commit”会为我执行此操作。 (git config --global core.editor“vim”)

答案 3 :(得分:2)

我遇到了同样的问题。尝试了别人推荐的所有方法后都失败了。 最后,我发现在我们的Ubuntu 14.04.1服务上,VIM没有默认安装!

很难实现这个问题,因为像我这样的VIM用户只是输入“vi”而不是“vim”,它显示了一个“VIM - 改进的VI”欢迎页面。

因此请确保已安装VIM:

whereis vim

或者只需输入:

vim

如果未安装,请按照建议执行:

sudo apt-get install vim

答案 4 :(得分:1)

vi~ / .gitconfig

[core]

 autocrlf = false

设置

[core]

 autocrlf = true

然后$ rm -rf~ / .vim / bundle / vundle

和$ git clone https://github.com/gmarik/vundle.git〜/ .vim / bundle / vundle

答案 5 :(得分:0)

答案 6 :(得分:0)

正如@romainl所说我的vundle安装在.vim/bundle/Vundle.vim/中,所以你需要更改一行: set rtp+=~/.vim/vundle.git/

set rtp+=~/.vim/bundle/Vundle.vim/

是的,谢谢你〜