加载中...

Vim 套件管理 - NeoBundle


完全用 GNU/Linux 工作

12. Vim 套件管理 - NeoBundle

原生的 Vim 已经很棒了,但为了让它更好用,我们可以借由扩充套件 (plugin) 来加速开发及编写文章的速度。但随着 plugin 的增长我们会更难管理,这时只需多装个套件管理员 (Vim plugin manager) 就可以解决此难题。

NeoBundle 是个基于 Vundle 而发展的 Vim 套件管理员 (plugin manager)。只需编写一个设定档就可以管理所有的 plugin。除了可省去个别安装的时间,也可透它进行更新 (NeoBundleUpdate)、重新安装 (NeoBundleReinstall) 及观看纪录 (NeoBundleLog) ... 等,就好比 Firefox, Google Chrome 的 Add-ons Manager 一样。

2013-09-30-neobundle.vim.png

安装 NeoBundle

建立 bundle 目录。

  1. $ mkdir -p ~/.vim/bundle

下载 NeoBundle plugin。

  1. $ git clone git://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim

于 .vimrc 最下方新增以下程式码。

  1. $ vi ~/.vimrc
  2. ......
  3. if has('vim_starting')
  4. set nocompatible " Be iMproved
  5. set runtimepath+=~/.vim/bundle/neobundle.vim/
  6. endif
  7. call neobundle#rc(expand('~/.vim/bundle/'))
  8. " Let NeoBundle manage NeoBundle
  9. NeoBundleFetch 'Shougo/neobundle.vim'
  10. " Recommended to install
  11. " After install, turn shell ~/.vim/bundle/vimproc, (n,g)make -f your_machines_makefile
  12. NeoBundle 'Shougo/vimproc'
  13. " My Bundles here:
  14. "
  15. " Note: You don't set neobundle setting in .gvimrc!
  16. " Original repos on github
  17. " -> TO DO ...
  18. filetype plugin indent on " Required!
  19. "
  20. " Brief help
  21. " :NeoBundleList - list configured bundles
  22. " :NeoBundleInstall(!) - install(update) bundles
  23. " :NeoBundleClean(!) - confirm(or auto-approve) removal of unused bundles
  24. " Installation check.
  25. NeoBundleCheck

请于 -> TO Do ... 中加入欲安装的套件 (套件路径请参考 GitHub 上的 Vim Plugins 网址。例如 nerdtree 的网址为 https://github.com/scrooloose/nerdtree 其套件路径为 'scrooloose/nerdtree')。

  1. " 例如:
  2. NeoBundle 'othree/html5.vim'
  3. NeoBundle 'BBCode--Dahn'
  4. NeoBundle 'plasticboy/vim-markdown'
  5. ......

执行 Vim 并使用 :NeoBundleInstall 安装各个 plugin。

最后,冻仁的套件列表已发布至 GitHub 上,若有不错的 plugin 也请告知冻仁,谢谢。

资料来源

  • 改用 NeoBundle 管理 Vim plugin - 没穿方服
  • 爽爽快快学Vim(3) - Vim Plugins - 高见龙
  • 十个必用的 Vim Plugin - OpenFoundry

还没有评论.