安装 vim 插件
git clone https://github.com/VundleVim/Vundle.vim.git
vim 配置
错误解决
VIM python 不能加载的问题。无法加载库 msys-pythonxxx.dll。这个需要主动设置python dll路径。
set pythonthreedll=D:/Program\ Files/Python38/python38.dll
git bash 配置
git 的配置可针对当前的工程或者针对当前的用户。
前者放在工程文件的 .git/config 文件中。
后者配置的时候需要增加 --global 选项,配置文件为 .gitconfig。
两者都可以直接编辑相关的配置文件或者通过命令行配置。
git bash 配置别名
alias cls='clear'
...
可以在 C:\Users\xxx\.gitconfig 进行 git 自身命令的别名配置。
[alias]
st = status
...
关于ctags和taglist的安装问题
ctags 使用
有时候我们希望忽略某些文件或者文件夹,不生成相关数据库。
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
关于 cscope 的使用问题
window 下我目前没有找到相关的安装方式,大家如果安装成功的请留言分享哈~
关于 cscope 的数据库生成
有时候我们希望忽略某些文件或者文件夹,不生成相关数据库。
cscope 没有 ctags 的 --exclude 选项。我们可以使用find命令把要生成数据库的文件收集起来给cscope。
$ find . -name "*.h" -o -name "*.asm" -o -name "*.cpp" > data.txt
$ cscope -bq -i data.txt
Linux 平台
主要介绍使用的插件和功能,具体可查阅网上的信息。
安装 ctags 及 cscope
sudo apt install exuberant-ctags cscope
安装Vundle
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’
Vim进阶
参考自
%: Go to the corresponding ( { [
*: go to next occurrence of the world under the cursor