Linux下用Vim+cscope+ctags打造具有Source Insight便利性的IDE

来源:互联网 发布:孔北海知世间有刘备耶 编辑:程序博客网 时间:2024/05/16 06:57

Vim简单介绍:Linux/Unix下的文本编辑软件。

使用Vim coding优势:

1.无需鼠标,全键盘操作。对于coding来说,可以双手专注盲打coding,无需切换鼠标导致分散注意力。

2.支持插件,从而可以利用插件,在Linux下将Vim打造成和SourceInsight一样强大的代码阅读器。

只需要学习简单的Vim基本命令,配置常用的插件,就可以把Vim打造成属于自己的编辑利器!

效果图如下,左边是function、中间是正文、右边是文件夹路径。


vim config已上传:http://download.csdn.net/detail/u014558668/9741632

只需要将其中的隐藏文件扔到编译网盘的根目录下,执行shell:.generate_cscope_ctags.sh  自动生成cscope&ctags,就能正常使用!


.vimrc如下

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" VIM userinterface"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""syntax enablesyntax onset nuset tabstop=4set softtabstop=4set shiftwidth=4set textwidth=80"Highlight search thingsset hlsearchset incsearch"show matching bracetsset showmatch"Always show current positionset ruler"Ignore case when searching"set ignorecase"Enable filetype pluginfiletype plugin onfiletype indent onset completeopt=longest,menu"Set to auto read when a file is changed from the outsideset autoread"Have the mouse enabled all the time:"set mouse=a"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Colors and Fonts"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""colorscheme desert"colorscheme desert_my"colorscheme murphy "colorscheme darkblueset guifont=Courier\ New:h10"set guifont=consolas"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Code fold """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set foldmarker={,}"set foldmethod=markerset foldmethod=syntaxset foldlevel=100       " Don't autofold anything (but I can still fold manually)"set foldopen-=search   " don't open folds when you search into them"set foldopen-=undo     " don't open folds when you undo stuff"set foldcolumn=4"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Plugin configuration"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Taglist setting""""""""""""""""""""""""""""""let Tlist_Ctags_Cmd = '/usr/bin/ctags'let Tlist_Show_One_File=1let Tlist_Exit_OnlyWindow=1"let Tlist_Use_Right_Window=1let Tlist_Show_Menu=1nmap tl :Tlist<cr>""""""""""""""""""""""""""""""" winmanager setting""""""""""""""""""""""""""""""let g:winManagerWindowLayout='BufExplorer,FileExplorer|Taglist'"let g:winManagerWidth = 30"let g:defaultExplorer = 0"let g:netrw_winsize = 30nmap wm :WMToggle<cr>""""""""""""""""""""""""""""""" miniBufExpl setting""""""""""""""""""""""""""""""let g:miniBufExplMapWindowNavArrows = 1let g:miniBufExplMapCTabSwitchBufs = 1nmap mb :TMiniBufExplorer<CR>""""""""""""""""""""""""""""""" mark setting""""""""""""""""""""""""""""""nmap <silent> <leader>hl <Plug>MarkSetvmap <silent> <leader>hl <Plug>MarkSetnmap <silent> <leader>hh <Plug>MarkClearvmap <silent> <leader>hh <Plug>MarkClearnmap <silent> <leader>hr <Plug>MarkRegexvmap <silent> <leader>hr <Plug>MarkRegex""""""""""""""""""""""""""""""" Grep setting""""""""""""""""""""""""""""""nnoremap <silent> <F3> :Rgrep<CR>""""""""""""""""""""""""""""""" a.vim setting:change .c to .h in the same dir""""""""""""""""""""""""""""""nnoremap <silent> <F12> :A<CR>"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ctags setting""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set tags=~/source/tagsset tags=tags;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" cscope setting"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set cscopequickfix=s-,c-,d-,i-,t-,e-set nocscopeverbose"cs add ~/source/cscope.out ~/sourceif filereadable("cscope.out")cs add cscope.out . endifnmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>nmap <C-\>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Coding setting """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""ab debug1 printf("@@@@@ %s %s line=%d\n",__FILE__,__func__,__LINE__);ab debug2 printf("@@@@@ %s line=%d\n",__func__,__LINE__);


0 0
原创粉丝点击