gvim8.0 compiler configuration under windows

Recently, due to various reasons, the IDE has been changed from source insight to vim. I have referred to many blog articles, and have tossed around for a long time. Now I summarize the experience:

Main reference:

Transform vim into source insight

Construction of gvim programming environment under Winxp

VIM study notes folding (Fold)

Effect picture:

 

 

 

1. Install:

Download gvim8.0 and install it

Just finished it looks like this:

 

2. Plug-in installation:

The selected plugins are as follows 

plugin name

effect

download link

 Installation method ( vimrc is uniformly configured later)

taglist

ctags-based taglist

http://www.vim.org/scripts/script.php?script_id=273

Unzip it to the .\vim80 directory

WinManager

Integrate FileExplore and Taglist

http://www.vim.org/scripts/script.php?script_id=95

Unzip it to the .\vim80 directory

Ctags

ctags, used to generate tag files (symbolic links)

http://ctags.sourceforge.net

Put ctags.exe in the .\vim80 path, and add vim80 to the environment variable /ctags.exe in the system32 path

Snipmate

Provides quick input of common codes (Tab completion)

http://www.vim.org/scripts/script.php?script_id=2540

Unzip it to the .\vimfiles directory

Supertab

Autocomplete with Tab key

http://www.vim.org/scripts/script.php?script_id=1643

Open the file in vim ($ vim supertab.vmb)
Source the file (:so %)

SrcExpl

Implement the function of the preview box of source insight

http://www.vim.org/scripts/script.php?script_id=2179

Unzip it to the .\vimfiles directory

Cscope

An enhanced version of ctags, which can generate not only source tags but also call tags

http://sourceforge.net/projects/mslk/files/

Unzip the archive and add the directory to the environment variable path

3. Theme installation:

The vim theme is monokai , and the font is consolas

Topic address: https://github.com/sickill/vim-monokai

Change the file name to monokai.vim and put it in vim80\colors\

Some modifications to personal preferences: (modify to the line corresponding to monokai.vim)

hi Search term=reverse cterm=NONE ctermfg=231 ctermbg=24 gui=NONE guifg=#f8f8f2 guibg=#AA0000
hi Folded ctermfg=242 ctermbg=235 cterm=NONE guifg=#75715e guibg=#272822 gui=NONE
hi FoldColumn ctermfg=242 ctermbg=235 cterm=NONE guifg=#75715e guibg=#272822 gui=NONE

  

4.vimrc changes:

 Add the following after the _vimrc file:

"Set Taglist
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1

"Use F8 to open Taglist
"nmap <F8> :TlistToggle<CR>
"Use F8 to open wimManager(FileExplorer+TagList)
let g:winManagerWindowLayout='FileExplorer|TagList'
nmap <F8> :WMToggle<cr>
"Use F9 to open SrcExpl
nmap <F9> :SrcExplToggle<CR>
let g:SrcExpl_jumpKey = "<ENTER>"
let g:SrcExpl_gobackKey = "<SPACE>"
let g:SrcExpl_prevDefKey = "<F3>"
let g:SrcExpl_nextDefKey = "<F4>"

"Set up SuperTab and use the tab key to turn on the autocomplete function of cppcomplet.
let g:SuperTabRetainCompletionType=2
let g:SuperTabDefaultCompletionType="<C-X><C-O>"
"Show line numbers
set number
"Set theme color font
colorscheme monokai
set guifont=Consolas:h12
"To use smart completion, turn on file type detection and turn off VI compatibility mode
filetype plugin indent on
set nocp
"character matches word
set incsearch
"Code Folding
set fdm=syntax
set foldlevel=1
set foldcolumn=2

Press F9 to open Source Explore, and F8 to open WindowManager

cscope settings: (I didn't use it)

See: http://cscope.sourceforge.net/cscope_maps.vim

"cscope
nmap <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>

 

5. Some other settings:

Tags generation (although Source Explore supports updating each time it is opened, but if it is opened for the first time without tags, it will be generated in the current directory. If the internal file of the project is opened, the tags will be incomplete, so it is best to generate it for the first time)

ctags -R ./Drvlib ./Source ./Include

cscope database generation (path changed to own)

find -P ./Drvlib ./Source ./Include > cscope.files
cscope -bq

cscope database contains (path changed to own)

cscope add ..\cscope.out

  

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325097228&siteId=291194637