安装好 git 后使用Vundle进行 Vim 的插件管理
在C:\Users\xxx\.vim
文件夹下,Git bash here
git clone https://github.com/VundleVim/Vundle.vim.git
此时vim的配置文件在 git 安装目录下的 etc 文件夹下,如
D:\Program Files\Git\etc
编辑其中的文件vimrc
,具体的配置文件见仁见智,网络上有很多。
git 的配置可针对当前的工程或者针对当前的用户
前者放在工程文件的.git/config
文件中
后者配置的时候需要增加--global
选项,配置文件为.gitconfig
两者都可以直接编辑相关的文件或者命令行配置
windows下可在Git安装目录如D:\Program Files\Git\etc\profile.d\aliases.sh
进行git bash别名的配置
alias cls='clear'
...
可以在C:\Users\xxx\.gitconfig
进行 git 命令的别名配置
[alias]
st = status
...
taglist依赖于ctags
ctags可以从这里下载ctags5.8
解压后将其中的ctags.exe
放到git安装目录下的usr\bin
目录下,如
D:\Program Files\Git\usr\bin
有时候我们希望忽略某些文件或者文件夹,不生成相关数据库。
ctags提供了--exclude
选项
ctags -R --exclude=dir1 --exclude=dir2 --exculde=for_exclude.c
同样也可以收集好想生成数据库的文件给ctags
$ find . -name "*.h" -o -name "*.asm" -o -name "*.cpp" > data.txt
$ ctags -L data.txt
window下我目前没有找到相关的安装方式,请大家安装成功的留言哈~
有时候我们希望忽略某些文件或者文件夹,不生成相关数据库。
cscope并没有ctags的--exclude
选项
我们可以使用find命令把要生成数据库的文件收集起来给cscope。
The standard procedure is to use the ‘find’ utility (if Unix), or your own script, to build a file that contains a list of each file you want indexed, then feed that to cscope with the -i option
$ find . -name "*.h" -o -name "*.asm" -o -name "*.cpp" > data.txt
$ cscope -bq -i data.txt
主要介绍使用的插件和功能,具体可查阅网上的信息。
sudo apt-get install exuberant-ctags cscope
Vundle可以作为Vim的包管理插件。方便与.vimrc
一同完成Vim的移植。
Vundle常用的指令如下:
- :PluginList lists configured plugins
- :PluginInstall installs plugins; append `!` to update or just :PluginUpdate
- :PluginClean confirms removal of unused plugins; append `!` to auto-approve removal
- :PluginUpdate
- :PluginSearch foo searches for foo; append `!` to refresh local cache
安装方式如下:
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
可以安装的Vim插件如下,作参考。
Plugin ‘Yggdroot/indentLine’
Plugin ‘ntpeters/vim-better-whitespace’
Plugin ‘vim-airline/vim-airline’
Plugin ‘tpope/vim-fugitive’
Plugin ‘chazy/cscope_maps’
Plugin ‘vim-scripts/taglist.vim’
Plugin ‘scrooloose/nerdtree’
Plugin ‘wesleyche/SrcExpl’
Plugin ‘wesleyche/Trinity’
Plugin ‘majutsushi/tagbar’
参考自1
%: Go to the corresponding ( { [
*: go to next occurrence of the world under the cursor
#: go to previous occurrence of the world under the cursor
http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/#navigation ↩︎