forked from aroma890225/vim-ide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
executable file
·100 lines (97 loc) · 3.91 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
colorscheme desert
syntax on
filetype plugin indent on
set t_Co=256
set background=dark "dark light "if you console background is white make it light
set nocompatible "some plugin need it
set hlsearch "highlight the search
set incsearch "move to fit position after one char input
set nobackup "won't produce the backup file when save file
set nowritebackup "won't produce the backup file when save file
set noswapfile "won't use swapfile
set hidden "can open other file when a file is not saved
set ruler "show ruler at the right bottom
set nowrap "disable auto newline
set laststatus=2 "status bar will show anytime
set updatetime=800 "tagbar response 800ms
set showmatch matchtime=0 "show the other bracket
set wmnu wildmode=longest:full "when in command mode can use auto complete same as bash
set expandtab tabstop=4 "expand the tab to 4 space
set ci cinoptions=g0,:0 "some indent rules
set shiftwidth=4 "make the indent 4 length
set softtabstop=4 "backspace can del 4 space
set lcs=eol:$,tab:\|\ "display tab to green line
set backspace=indent,eol,start "better backspace
set fileencodings=utf-8,cp936 "auto test the file is uft-8 or cp936
set fileformats=unix,dos,mac "line feed different in different mode
set completeopt=menuone,longest
highlight default link TagbarHighlight Title
let NERDTreeQuitOnOpen=1
let NERDTreeDirArrows=0
let NERDTreeWinSize=40
let NERDRemoveExtraSpaces=0
let g:bufExplorerDisableDefaultKeyMapping = 1
let g:acp_behaviorKeywordCommand = "\<C-o>"
let g:acp_behaviorKeywordLength = -1
let g:acp_behaviorFileLength = -1
let g:SuperTabDefaultCompletionType = "<c-n>"
let g:SuperTabLongestHighlight = 1
let g:tagbar_sort=0
let g:tagbar_compact=1
let g:tagbar_foldlevel=1
let g:tagbar_iconchars=['+', '-']
let OmniCpp_SelectFirstItem = 2
let OmniCpp_ShowPrototypeInAbbr = 1
let OmniCpp_MayCompleteScope = 1
"file list
map <silent> <F2> :NERDTreeToggle<cr>
"tarbar functon list
map <silent> <F3> :TagbarToggle<cr>
"header and implement file switch
map <F4> :A<cr>
"update index
map <F5> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q<cr><cr>:cs kill cscope.out<cr>:!cscope -Rb<cr><cr>:cs add cscope.out<cr>
"switch paste mode
map <F6> :set paste!<cr>:set paste?<cr>
"highlight
map <F7> ms:%s /\<<C-R>=expand("<cword>")<CR>\>//gn<cr>`s
"swapfile list
map <silent> <F8> :BufExplorer<CR>
"comment visual line
vnoremap <silent> , :call NERDComment(1, "alignLeft")<cr>
"uncomment visual line
vnoremap <silent> . :call NERDComment(1, "uncomment")<cr>
"show list if more tag
nnoremap <c-]> g<c-]>
"move to right window
noremap <c-l> <c-w>l
"move to up window
noremap <c-k> <c-w>k
"move to down window
noremap <c-j> <c-w>j
"move to left window
noremap <c-h> <c-w>h
"goto the place where word definition
nmap <C-[>g :cs find g <C-R>=expand("<cword>")<CR><CR>
"list the funcion called by this function
nmap <C-[>d :cs find d <C-R>=expand("<cword>")<CR><CR>
"list the position where to call this word
nmap <C-[>c :cs find c <C-R>=expand("<cword>")<CR><CR>
"search word in the project
nmap <C-[>s :cs find s <C-R>=expand("<cword>")<CR><CR>
"search word in the project and the word can be in text
nmap <C-[>t :cs find t <C-R>=expand("<cword>")<CR><CR>
"search word in the project and the word can be in text, support regex
nmap <C-[>e :cs find e <C-R>=expand("<cword>")<CR><CR>
"list the file which filename is this word
nmap <C-[>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
"list the file include the file which filename is this word
nmap <C-[>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
"list the file which include this file
nmap <C-[>I :cs find i <C-R>=expand("%:t")<CR><CR>
if has("cscope")
set nocsverb
if filereadable("cscope.out")
cs add cscope.out
endif
endif