Vim 配置

2017-03-13  本文已影响0人  Lin_ZJ

插件

~/.vimrc
"--------------------------------------------------"
"Vim 环境设置
"--------------------------------------------------"
set nu "line number
set ai "auto indent
set ts=4 "tab size
set bg=dark "backgroud color
"--------------------------------------------------"
"ctags database path 设置
"--------------------------------------------------"
set tags=[pwd]/tags
"--------------------------------------------------"
"cscope database path 设置
"--------------------------------------------------"
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb
cs add [pwd]/cscope.out [pwd]
set csverb
"--------------------------------------------------"
"Tap List 环境设置
"--------------------------------------------------"
filetype on
nmap <F7> :TlistToggle<CR>
let Tlist_Ctags_Cmd = "/usr/bin/ctags"
let Tlist_Inc_Winwidth = 0
let Tlist_Exit_OnlyWindow = 0
let Tlist_Auto_Open = 0
let Tlist_Use_Right_Window = 1
"--------------------------------------------------"
"Source Explorer 环境设置
"--------------------------------------------------"
nmap <F8> :SrcExplToggle<CR>
nmap <C-H> <C-W>h
nmap <C-J> <C-W>j
nmap <C-K> <C-W>k
nmap <C-L> <C-W>l
let g:SrcExpl_winHeight = 8
let g:SrcExpl_refreshTime = 100
let g:SrcExpl_jumpKey = "<ENTER>"
let g:SrcExpl_gobackKey = "<SPACE>"
let g:SrcExpl_isUpdateTags = 0
"--------------------------------------------------"
"NERD Tree 环境设置
"--------------------------------------------------"
let NERDTreeWinPos = "left"
nmap <F9> :NERDTreeToggle<CR>

快捷键:

Ctrl+] 移动到定义函数的位置
Ctrl+t 移动到移动前的位置
:cs find <querytype> <name>

querytype 说明
0 or s 查找C符号
1 or g 查找定义(definition)
2 or d 查找被该函数调用的(called)函数
3 or c 查找调用该函数的(calling)函数
4 or t 查找文本字符串(text string)
6 or e 查找egrep模式
7 or f 查找文件
8 or i 查找用#include包含该文件的文件
上一篇下一篇

猜你喜欢

热点阅读