原文有些地方已经过时,不再适用。
几个有用的网站:
一:准备材料
$ git clone https://github.com/sontek/dotfiles.git
###之前已经安装过vim,不知下面两个命令的作用,暂时没有执行###
$ cd dotfiles
$ ./install.sh vim
Because one of the most important parts about a development environment is the ability to easily reproduce across machines, we are going to store our vim configuration in git:
$ mkdir ~/.vim/
$ mkdir ~/.vim/{autoload,bundle}
$ cd ~/.vim/
$ git init
The purpose of the autoload directory is to automatically load the vim plugin Pathogen, which we’ll then use to load all other plugins that are located in the bundle directory. So download pathogen and put it in your autoload folder.
Pathogen是一种插件管理工具
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
execute pathogen#infect()
syntax on
filetype plugin indent on
安装你所需要的各种插件:下载到bundle目录下,然后在.vimrc中进行相应的设置,如果不进行设置,则不起作用。
比如,要使用代码结构浏览工具Tagbar :(当然,用这个工具之前得先安装Ctags:sudo apt-get install exuberant-ctags)
cd .vim
git submodule add https://github.com/majutsushi/tagbar.git bundle/tagbar.git
git submodule init
git submodule update
Put something like the following into your ~/.vimrc:
nmap :TagbarToggle Then the F8 key will toggle the Tagbar window. You can of course use any shortcut you want. For more flexible ways to open and close the window (and the rest of the functionality) see the documentation.
之后,在vim中按F8就可调出tagbar了。
cd .vim
git submodule add http://github.com/tpope/vim-fugitive.git bundle/fugitive
git submodule add https://github.com/msanders/snipmate.vim.git bundle/snipmate
git submodule add https://github.com/tpope/vim-surround.git bundle/surround
git submodule add https://github.com/tpope/vim-git.git bundle/git
git submodule add https://github.com/ervandew/supertab.git bundle/supertab
git submodule add https://github.com/sontek/minibufexpl.vim.git bundle/minibufexpl ###已不可用
git submodule add https://github.com/wincent/Command-T.git bundle/command-t
git submodule add https://github.com/mitechie/pyflakes-pathogen.git bundle/pyflakes-pathogen
git submodule add https://github.com/mileszs/ack.vim.git bundle/ack
git submodule add https://github.com/sjl/gundo.vim.git bundle/gundo
git submodule add https://github.com/fs111/pydoc.vim.git bundle/pydoc
git submodule add https://github.com/vim-scripts/pep8.git bundle/pep8
git submodule add https://github.com/alfredodeza/pytest.vim.git bundle/py.test
git submodule add https://github.com/reinh/vim-makegreen bundle/makegreen
git submodule add https://github.com/vim-scripts/TaskList.vim.git bundle/tasklist ###有问题
git submodule add https://github.com/vim-scripts/The-NERD-tree.git bundle/nerdtree
git submodule add https://github.com/sontek/rope-vim.git bundle/ropevim ###已不可用
git submodule add https://github.com/majutsushi/tagbar.git bundle/tagbar
git submodule init
git submodule update
git submodule foreach git submodule init ###没成功
git submodule foreach git submodule update ###没成功