-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc_private
123 lines (99 loc) · 3.09 KB
/
vimrc_private
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
" syntastic setting
" for c++11
let g:syntastic_cpp_compiler = 'clang++'
let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++'
hi normal guifg=lightgray guibg=black
"NERDTree
"nnoremap <silent> <F5> :NERDTree<CR>
map <F5> :NERDTreeToggle<CR>
"Use the natural vim navigation keys hjkl to navigate the files.
"Press o to open the file in a new buffer or open/close directory.
"Press t to open the file in a new tab.
"Press i to open the file in a new horizontal split.
"Press s to open the file in a new vertical split.
"Press p to go to parent directory.
"Press r to refresh the current directory.
"
"
set hls
hi normal guifg=lightgray guibg=black
colorscheme wombat256
hi normal ctermfg=252 ctermbg=234 guifg=#e3e0d7 guibg=#242424
hi cursorcolumn term=reverse ctermbg=242 guibg=Grey40
"-----------
" highlight cursor line
"-----------
set cursorline
set cursorcolumn
hi CursorLine cterm=NONE ctermbg=darkblue
"highlight cursorline guibg=blue
"highlight cursorcolumn guibg=blue
"hi CursorLine cterm=NONE ctermbg=lightgray ctermfg=white guibg=darkred guifg=white
"hi CursorColumn cterm=NONE ctermbg=blue ctermfg=white guibg=darkred guifg=white
nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
"------------
"for tab
"------------
map tn :tabnext<CR>
map tp :tabprev<CR>
map te :tabnew
map tc :tabclose<CR>
nmap <C-h> :tabprevious<CR>
nmap <C-l> :tabnext<CR>
map <C-h> :tabprevious<CR>
map <C-l> :tabnext<CR>
imap <C-h> <Esc>:tabprevious<CR>i
imap <C-l> <Esc>:tabnext<CR>i
"nmap <C-t> :tabnew<CR>
"imap <C-t> <Esc>:tabnew<CR>
"for tagbar
" for C++ tags
"nnoremap <silent> <F4> :TagbarToggle<CR>
"for paste mode
map <F10> :call Paste_on_off()<CR>i
set pastetoggle=<F10>
let paste_mode = 0
func! Paste_on_off()
if g:paste_mode == 0
set paste
let g:paste_mode = 1
else
set nopaste
let g:paste_mode = 0
endif
return
endfunc
if has("autocmd")
autocmd BufRead,BufNewFile * set kp=man\ -a
autocmd BufRead,BufNewFile *.py set kp=pydoc
autocmd BufRead,BufNewFile *.conf,.* set nocin noai
autocmd BufRead,BufNewFile *.erl set kp=erl\ -man
endif
set foldmethod=indent "marker
" Hightlight extra space
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
let g:ackprg="gid_with_col.py"
nnoremap <silent> <F4> :Ack<CR>
nnoremap <Leader>g :Ack<CR>
" clang-format
let g:clang_format#style_options = {
\ "AccessModifierOffset" : -4,
\ "AllowShortIfStatementsOnASingleLine" : "true",
\ "AlwaysBreakTemplateDeclarations" : "true",
\ "Standard" : "C++11"}
let g:clang_format#detect_style_file = 1
" map to <Leader>cf in C++ code
map <F5> :ClangFormat<CR>
" if you install vim-operator-user
"autocmd FileType c,cpp,objc map <buffer><Leader>x <Plug>(operator-clang-format)
" Toggle auto formatting:
nmap <Leader>C :ClangFormatAutoToggle<CR>
"for trace code
nmap ,, :vnew %<CR>
nmap ,. :tabe %<CR>
"----