Vundle:Vim Plugin 自動下載、安裝、更新與管理工具(Vim Bundle)

Vundle是一款强大的Vim插件管理工具,它能够帮助用户轻松地安装、更新及管理各种Vim插件。只需在.vimrc文件中进行简单配置,即可实现插件的一键安装与更新。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Vundle  是一個可以自動下載、安裝與管理 Vim plugins 的工具,讓 Vim 的使用者可以很方便的使用各種 plugins。

Vim Logo

Vim 編輯器可以透過各種 plugin 來增加各種功能,在  Vim Scripts  網站上收錄了非常大量的 Vim 指令稿,使用者可以自己下載後安裝在 Vim 中使用。雖然這些 plugins 可以加強 Vim 的功能,但是如果安裝了太多的 plugins,在管理上就會比較麻煩,這時候就可以使用 Vundle 來幫忙管理所有的 Vim plugins。

Vundle(Vim Bundle 的簡稱)是一個 Vim plugin 管理工具,主要功能如下:
  • 在 .vimrc 中統一管理所有的 plugin 設定。
  • 安裝 plugin。
  • 更新 plugin。
  • 以名稱搜尋 Vim Scripts 網站的 plugin。
  • 清除沒有用到的 plugin。
  • 互動式操作介面。
基本上 Vundle 提供了一般使用者很完整的 plugin 管理功能,只要有了這個工具,所有關於 plugin 的安裝與管理動作,都可以在 Vim 的環境下進行,既快速又方便。以下是 Vundle 的安裝與使用方式。

安裝

由於 Vundle 會需要 Git(用於下載 plugin)與 Curl(用於搜尋 plugin)兩項工具,所以在安裝 Vundle 之前要先安裝這兩個工具,若在 Ubuntu Linux 中可以使用 apt 安裝:
apt-get install git curl

接著安裝 Vundle:
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

然後設定  .vimrc ,加下面這段設定貼在  .vimrc  的開頭:
set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" alternatively, pass a path where Vundle should install plugins
"let path = '~/some/path/here'
"call vundle#rc(path)

" let Vundle manage Vundle, required
Plugin 'gmarik/vundle'

" The following are examples of different formats supported.
" Keep Plugin commands between here and filetype plugin indent on.
" scripts on GitHub repos
Plugin 'tpope/vim-fugitive'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'tpope/vim-rails.git'
" 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/'}
" scripts from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
Plugin 'FuzzyFinder'
" scripts not 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'
" ...

filetype plugin indent on     " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList          - list configured plugins
" :PluginInstall(!)    - install (update) plugins
" :PluginSearch(!) foo - search (or refresh cache first) for foo
" :PluginClean(!)      - confirm (or auto-approve) removal of unused plugins
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Plugin commands are not allowed.
" Put your stuff after this line
其中所有  Plugin  開頭的設定,除了  Plugin 'gmarik/vundle'  之外,都可以依照自己的需求決定是否要加入。

最後在 Vim 中執行  :PluginInstall  安裝  .vimrc  中所設定的 plugins,或是在終端機中執行
vim +PluginInstall +qall
這樣也可以安裝所有的 plugins。

Vundle 的網站 上有一些寫好的範例,一開始如果不知道該如何選擇 plugin,可以先直接使用別人寫好的  .vimrc  檔來修改,這樣會比較省時間。

fisa-vim-config 設定檔

如果你有使用 Vim 來開發 Python 程式,建議可以參考  fisa-vim-config  這個設定檔,它把各種 plugin 整合的很好,下面這個是使用的畫面。

自動補齊(auto-completion)

類別(class)瀏覽器

自動偵測錯誤

模糊(fuzzy)搜尋

在 fisa-vim-config 的網頁中有詳細介紹它所提供的功能與特色,另外也詳述了相關 Python 開發工具的安裝方式與字型的安裝與設定,如果你想要打造一個一模一樣的環境,可以參考他的網頁說明。


From:  http://www.gtwang.org/2014/04/vundle-vim-bundle-plugin-manager.html


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值