-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
336 lines (261 loc) · 9.03 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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
"autocmd! bufwritepost .vimrc source %
set nocompatible
let g:syntastic_cpp_compiler = 'clang++'
let g:syntastic_cpp_config_file = '.clang_complete'
let g:syntastic_cpp_compiler_options = '-fPIC'
let g:syntastic_check_on_open = 1
let g:syntastic_enable_signs = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_python_checkers=['flake8']
let g:syntastic_python_checker_args='--ignore=E501,E225'
let g:syntastic_loc_list_height = 5
let g:clang_complete_copen = 1
let g:clang_user_options='|| exit 0'
let g:clang_auto_select = 1
"let g:clang_use_library=1
au! BufEnter *.cc let b:fswitchdst = 'h' | let b:fswitchlocs = './'
au! BufEnter *.h let b:fswitchdst = 'cc,c' | let b:fswitchlocs = './'
call pathogen#infect()
"set autoindent
set smartindent
set cursorline
set mouse=a
set showmatch
"colorscheme marklar
set ruler
set wrap
set incsearch
set number
set laststatus=2
set t_Co=256
set encoding=utf-8
"let g:Powerline_theme = 'solarized256'
"set foldmethod=indent
set nofoldenable
let g:DisableAutoPHPFolding = 1
set clipboard=unnamed
syntax on
let mojo_highlight_data = 1
set hls
set softtabstop=4
set shiftwidth=4
set expandtab
set ttymouse=xterm2
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
inoremap <expr><C-y> neocomplete#close_popup()
inoremap <expr><C-e> neocomplete#cancel_popup()
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
if has("persistent_undo")
set undodir =~/.undodir//
set undofile
endif
"set nowrap linebreak textwidth=80
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
filetype plugin on
set grepprg=grep\ -nH\ $*
let g:tex_flavor='latex'
set backspace=indent,eol,start
autocmd BufNewFile *.erl exe "normal! i-module(". expand('%:t:r') . ").\n-compile(export_all).\n\n"
autocmd BufNewFile *.java exe "normal! ipublic class ". expand('%:t:r'). " {\n\n\tpublic ".expand('%:t:r') ."() {\n\n}\n}\n"
autocmd BufNewFile *.cu exe "normal! i__global__ void ". expand('%:t:r'). "() {\n\n}\n"
autocmd BufNewFile,BufRead *.pro set filetype=make
autocmd BufNewFile,BufRead SCons* set filetype=scons
autocmd BufNewFile,BufRead *.ninja set filetype=ninja
autocmd BufNewFile,BufRead *.exs set filetype=elixir
autocmd BufNewFile,BufRead *.sls set filetype=yaml
"autocmd Filetype cpp set tags+=~/.vim/tags/stdlib
autocmd Filetype cpp set tags+=~/.vim/tags/qtcore
autocmd FileType html,markdown set omnifunc=htmlcomplete#CompleteTags
autocmd FileType python set omnifunc=pythoncomplete#Complete
"autocmd FileType cpp set omnifunc=complete#CompleteTags
"autocmd FileType cpp set omnifunc=omni#cpp#complete#Main
autocmd FileType css,scss,styl set omnifunc=csscomplete#CompleteCSS
autocmd Filetype ruby compiler ruby
autocmd InsertEnter * syn clear EOLWS | syn match EOLWS excludenl /\s\+\%#\@!$/
autocmd InsertLeave * syn clear EOLWS | syn match EOLWS excludenl /\s\+$/
highlight EOLWS ctermbg=red guibg=red
inoremap ( ()<Left>
inoremap <expr> ) strpart(getline('.'), col('.')-1, 1) == ")" ? "\<Right>" : ")"
inoremap [ []<Left>
inoremap <expr> ] strpart(getline('.'), col('.')-1, 1) == "]" ? "\<Right>" : "]"
inoremap { {}<Left>
inoremap <expr> } strpart(getline('.'), col('.')-1, 1) == "}" ? "\<Right>" : "}"
"Omni complete related
map <F12> :!ctags -R --sort=yes --c++-kinds=+svpctn --fields=+iaS --extra=+q .<CR>
"let OmniCpp_NamespaceSearch = 2
let OmniCpp_DisplayMode = 1
"let OmniCpp_ShowPrototypeInAbbr = 1
let OmniCpp_MayCompleteDot = 1
let OmniCpp_MayCompleteArrow = 1
let OmniCpp_MayCompleteScope = 1
set completeopt=menuone,menu,longest,preview
set complete-=i
let g:ctrlp_z_nerdtree = 1
let g:ctrlp_extensions = ['Z', 'F']
nnoremap sz :CtrlPZ<Cr>
nnoremap sf :CtrlPF<Cr>
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
map <C-b> :!make<CR>
map <C-u> :!./run_tests --log_level=test_suite<CR>
map <C-c> :!make clean
map <C-t> :!make test<CR>
map fe :NERDTreeToggle<CR>
",v brings up my .vimrc
"",V reloads it -- making all changes active (have to save first)
map ,v :sp /home/jurnell/.vimrc<CR><C-W>_
map <silent> ,V :source /home/jurnell/.vimrc<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR>
let vimclojure#HighlightBuiltins=1
let vimclojure#ParenRainbow=1
let g:clojure_simplefold_nestable_start_expr = '\v\(defn'
let g:clojure_simplefold_nestable_end_expr = '\v^\s*$'
let g:C_Styles = { '*.c' : 'default', '*.h,*.cc,*.cpp,*.hh,*.hpp' : 'CPP' }
map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>
noremap ; :
map <C-h> :tabprevious<CR>
map <C-l> :tabnext<CR>
map <C-left> :tabprevious<CR>
map <C-right> :tabnext<CR>
noremap [ {
noremap ] }
nmap <F4> :%s//gc<left><left><left>
map <F1> :%s/<C-r><C-w>//gc<left><left><left>
let g:tex_flavor='latex'
"set directory=~/.backup//
imap ii <Esc>
imap ,, <Esc>
nnoremap aa :let @/=""<CR>
" latex suite settings
let g:Tex_Env_frame = "\\begin{frame}{<++>}\<CR><++>\<CR>\\end{frame}\<CR>\<CR><++>"
let g:Tex_Env_fframe = "\\begin{fframe}[<++>]{<++>}\<CR><++>\<CR>\\end{fframe}\<CR>\<CR><++>"
let g:Tex_Env_sverb = "\\begin{sverb}\<CR>\uncover\<<++>\>{<++>}\<CR>\\end{sverb}"
let g:Tex_AutoFolding = 0
autocmd Filetype ruby setlocal ts=2 sts=2 sw=2
autocmd Filetype yaml setlocal ts=2 sts=2 sw=2
autocmd Filetype html setlocal ts=2 sts=2 sw=2
autocmd Filetype sass setlocal ts=2 sts=2 sw=2
noremap ,t :call PyUnitRunTests()<CR>
noremap! ,t <Esc>:call PyUnitRunTests()<CR>
"let g:PyUnitTestsStructure = 'side-by-side'
"let g:PyUnitConfirmTestCreation = 1
let g:django_projects = '~/sophic'
let g:django_activate_virtualenv = 1
" use cppcheck
"comp cppcheck
" plug make ouput on quickfix window
command -nargs=* Make make <args> | cwindow 10
nnoremap <F9> i<CR><ESC>
let g:neocomplete#sources#syntax#min_keyword_length = 3
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
map <c-h> <c-w>h
map <c-q> <c-w>q
" default the statusline to green when entering
" Vim
hi statusline guibg=DarkGrey ctermfg=8 guifg=White ctermbg=15
"
set statusline =%#identifier#
set statusline+=[%t] "tail of the filename
set statusline+=%*
set statusline+=%#warningmsg#
set statusline+=%{&ff!='unix'?'['.&ff.']':''}
set statusline+=%*
set statusline+=%#warningmsg#
set statusline+=%{(&fenc!='utf-8'&&&fenc!='')?'['.&fenc.']':''}
set statusline+=%*
set statusline+=%h "help file flag
set statusline+=%y "filetype
set statusline+=%#identifier#
set statusline+=%r
set statusline+=%*
set statusline+=%#identifier#
set statusline+=%m
set statusline+=%*
set statusline+=%{fugitive#statusline()}
set statusline+=%#error#
set statusline+=%{StatuslineTabWarning()}
set statusline+=%*
set statusline+=%{StatuslineTrailingSpaceWarning()}
"set statusline+=%{StatuslineLongLineWarning()}
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
set statusline+=%#error#
set statusline+=%{&paste?'[paste]':''}
set statusline+=%*
set statusline+=%= "left/right separator
set statusline+=%{StatuslineCurrentHighlight()}\ \ "current highlight
set statusline+=%c, "cursor column
set statusline+=%l/%L "cursor line/total lines
set statusline+=\ %P "percent through file
hi Visual ctermfg=White ctermbg=LightBlue cterm=none
function! StatuslineTrailingSpaceWarning()
if !exists("b:statusline_trailing_space_warning")
if !&modifiable
let b:statusline_trailing_space_warning = ''
return b:statusline_trailing_space_warning
endif
if search('\s\+$', 'nw') != 0
let b:statusline_trailing_space_warning = '[\s]'
else
let b:statusline_trailing_space_warning = ''
endif
endif
return b:statusline_trailing_space_warning
endfunction
function! StatuslineCurrentHighlight()
let name = synIDattr(synID(line('.'),col('.'),1),'name')
if name == ''
return ''
else
return '[' . name . ']'
endif
endfunction
function! StatuslineTabWarning()
if !exists("b:statusline_tab_warning")
let b:statusline_tab_warning = ''
if !&modifiable
return b:statusline_tab_warning
endif
let tabs = search('^\t', 'nw') != 0
"find spaces that
"arent used as
"alignment in the
"first indent column
let spaces = search('^ \{' . &ts . ',}[^\t]', 'nw') != 0
if tabs && spaces
let b:statusline_tab_warning = '[mixed-indenting]'
elseif (spaces && !&et) || (tabs && &et)
let b:statusline_tab_warning = '[&et]'
endif
endif
return b:statusline_tab_warning
endfunction
let g:tagbar_autoclose = 0
let g:tagbar_usearrows = 1
nnoremap <silent> <Leader>b :TagbarToggle<CR>
set colorcolumn=80
map ev :vsplit
map ee :split
" Some git aliases for figutive usage
map gci :Gcommit<CR>
map glola :Git lola<CR>
map glol :Git lol<CR>
map ga :Gwrite<CR>
map gst :Gstatus<CR>
map gl :Glog<CR>
map jk <ESC>
"FSwitch mappings
nmap <silent> <Leader>of :FSHere<cr>
nmap <silent> <Leader>oL :FSSplitRight<cr>
nmap <silent> <Leader>oJ :FSSplitBelow<cr>