-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
229 lines (142 loc) · 4.59 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
""""""""""""""""""""""""""""""""""""""""""
" Runtime path for VIM plugins and scripts
set runtimepath+=/usr/share/vim/vim81
set runtimepath+=/usr/share/vim/vim80
set runtimepath+=/u/cd2zyg/installed/share/vim/vim82
set runtimepath+=~/vimconf
set runtimepath+=~/vimconf/after
set rtp^=/vimconf
""""""""""""""""""""""""""""""""""""""""""
set nocompatible
"""""""""""""""""""""""""""""""""""""""""
" File Format defines the line endings
set fileformats=unix,dos
""""""""""""""""""""""""""""""""""""""""""
" Run pathogen on runtime's subdirectories
execute pathogen#infect()
" Invoke ":helptags" on all "doc" subdirectories in the "runtimepath" variable.
call pathogen#helptags()
filetype plugin indent on
syntax on
""""""""""""""""""""""""""""""""""""""""""
" For some simple "fuzzy" search
set path+=**
set wildmenu
""""""""""""""""""""""""""""""""""""""""""
" CTAGS
command! MakeTags !ctags -R .
""""""""""""""""""""""""""""""""""""""""""
set cursorline
""""""""""""""""""""""""""""""""""""""""""
let mapleader = "\<Space>"
""""""""""""""""""""""""""""""""""""""""""
" use UTF-8
set encoding=utf-8
""""""""""""""""""""""""""""""""""""""""""
" Display non-printable characters
set list
set listchars=trail:·,precedes:«,extends:»,tab:▸-
" eol:↲
"""""""""""""""""""""""""""""""""""""""""
" Convert tabs to spaces
set expandtab
set tabstop=2
set sw=2
"""""""""""""""""""""""""""""""""""""""""
" Display line numbers
set number
"""""""""""""""""""""""""""""""""""""""""
" Swap and backup
set writebackup
set backup
set backupcopy=yes
set backupskip=
set backupdir=~/.backup
autocmd BufWritePre * let &backupext = '~@'
\ . substitute(expand('%:p:h'), '[\\/:]', '%', 'g')
set swapfile
set updatetime=2000
set directory=~/.swap//
"""""""""""""""""""""""""""""""""""""""""
" Search and scrolling
" Scroll offset. Try to keep the cursor in the middle of the screen
"set scrolloff=50
"""""""""""""""""""""""""""""""""""""""""
" Search / Regular Expressions
" Wrap around the end of the file when searching.
set wrapscan
" Highlight search matches.
set hlsearch
" Search as you type.
set incsearch
" Ignore case in the search pattern.
set ignorecase
" Override the "ignorecase" option if the search pattern contains uppercase
" letters.
set smartcase
" In regular expressions, treat most characters literally, while require
" certain ones to be preceded with backward slash "\" in order to gain special
" meaning.
set magic
"""""""""""""""""""""""""""""""""""""""""
" GUI MODE for gvim
if has("gui_running")
set background=dark
colorscheme gruvbox
set guifont=Droid\ Sans\ Mono\ 12
set guifont=Ubuntu\ Mono\ 12
" remove menu and toolbar
set guioptions -=m
set guioptions -=T
map <Leader>bg :let &background = (&background == "dark" ? "light" : "dark")<CR>
endif
" if $COLORTERM == 'gnome-terminal'
" set t_Co=256
" endif
set background=dark
colorscheme gruvbox
"""""""""""""""""""""""""""""""""""""""""
" NERD Tree
nnoremap <Leader>t :NERDTreeToggle<CR>
let g:NERDTreeMapHelp = '<F1>'
let g:NERDTreeMapChangeRoot = 'r'
"""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""
" NERD Commenter
noremap CC :call NERDComment(0, "toggle")<CR>
"""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""
" delimitMate
"let g:delimitMate_excluded_regions = ''
"let g:delimitMate_matchpairs = '(:),[:],{:}'
let g:delimitMate_balance_matchpairs = 1
set backspace=2
let g:delimitMate_expand_cr = 1
let g:delimitMate_expand_space = 1
"""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""
" vim-airline
set laststatus=2
"""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""
" "fswitch"
autocmd BufEnter *.hpp let b:fswitchdst = 'cpp,c++,cxx,cc,c'
autocmd BufEnter *.cpp let b:fswitchdst = 'hpp,h++,hxx,hh,h'
autocmd BufEnter *.hpp,*.h++,*.hxx,*.hh,*.h let b:fswitchlocs = 'reg:/include/src/,reg:/include.*/src/'
autocmd BufEnter *.cpp,*.c++,*.cxx,*.cc,*.c let b:fswitchlocs = 'reg:/src/include/,reg:|src|include/**|'
nnoremap <silent> <Leader>s :up<CR>:FSHere<CR>
"""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""
" YouCompleteMe
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_confirm_extra_conf = 0
"""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""
" CtrlP
let g:ctrlp_max_files=0
if executable('rg')
let g:ctrlp_user_command = 'rg %s --files --hidden --color=never --glob ""'
endif
let g:ctrlp_custom_ignore = 'lib\/'
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_cache_dir = '~/.cache/ctrlp'