comparison vim/vimrc @ 210:477efa0013fd

Merge changes.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 01 Sep 2014 08:47:21 -0700
parents d482e6144d52 4bd15b5afcfc
children da7af1f2823c
comparison
equal deleted inserted replaced
209:a903bd42d8d9 210:477efa0013fd
248 248
249 " Syntastic {{{ 249 " Syntastic {{{
250 250
251 " Use `pyflakes` with `syntastic`. 251 " Use `pyflakes` with `syntastic`.
252 "let g:syntastic_python_checkers = ['pyflakes'] 252 "let g:syntastic_python_checkers = ['pyflakes']
253 "let g:syntastic_mode_map = {
254 " \'mode': 'active',
255 " \'passive_filetypes': []}
256 253
257 " }}} 254 " }}}
258 255
259 " Lawrencium {{{ 256 " Lawrencium {{{
260 257
282 279
283 " }}} 280 " }}}
284 281
285 " Python-Mode {{{ 282 " Python-Mode {{{
286 283
287 let g:pymode = 0 284 let g:pymode = 1
285 let g:pymode_python = 'disable'
286 let g:pymode_syntax_all = 1
287 let g:pymode_syntax_print_as_function = 1
288 let g:pymode_syntax_space_errors = 1
289 let g:pymode_run = 0
290 let g:pymode_lint = 0
291 let g:pymode_trim_whitespaces = 0
292 let g:pymode_virtualenv = 0
293 let g:pymode_folding = 1
294
295 if !has('python')
296 let g:pymode = 0
297 endif
288 298
289 " }}} 299 " }}}
290 300
291 " }}} 301 " }}}
292 302
293 " File-Specific Settings {{{ 303 " File-Specific Settings {{{
294 304
295 if has("autocmd") 305 " Automatically change the current working directory based on a project
296 306 " I'm in.
297 augroup VimRCAutoCWD 307 augroup VimRCAutoCWD
298 au! 308 au!
299 309 autocmd BufEnter * call s:SetProjectRootCwd()
300 autocmd BufEnter * call s:SetProjectRootCwd() 310 augroup END
301 augroup END 311
302 312 augroup VimRCFileType_markdown
303 augroup VimRCFileTypeSettings 313 au!
304 au! 314 autocmd FileType text,markdown setlocal textwidth=80
305 315 autocmd FileType markdown nnoremap <buffer> <localleader>1 yypVr=:redraw<cr>
306 " Nice text width for text files. 316 autocmd FileType markdown nnoremap <buffer> <localleader>2 yypVr-:redraw<cr>
307 autocmd FileType text,markdown setlocal textwidth=80 317 autocmd FileType markdown nnoremap <buffer> <localleader>3 mzI###<space><esc>`z4l
308 318 autocmd FileType markdown nnoremap <buffer> <localleader>4 mzI####<space><esc>`z5l
309 " Who the hell changes my matchpairs? 319
310 autocmd FileType php setlocal matchpairs-=<:> 320 autocmd BufRead,BufNewfile */Dropbox/Personal/SimpleNote/* set ft=markdown
311 321 autocmd BufRead,BufNewFile */_content/**/*.html set ft=piecrustmarkdown
312 " File I know are markdown: personal notes & PieCrust pages. 322 augroup END
313 autocmd BufRead,BufNewfile */Dropbox/Personal/SimpleNote/* set ft=markdown 323
314 autocmd BufRead,BufNewFile */_content/**/*.html set ft=piecrustmarkdown 324 augroup VimRCFileType_php
315 325 au!
316 augroup END 326 " Who the hell changes my matchpairs?
317 327 autocmd FileType php setlocal matchpairs-=<:>
318 augroup VimRCTrailingWhitespaces 328 augroup END
319 au! 329
320 330 augroup VimRCFileType_c
321 autocmd FileType c,cpp,java,php,ruby,python,js,css,less autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces() 331 au!
322 augroup END 332 autocmd FileType c,c++ setlocal foldmethod=marker foldmarker={,}
323 333 augroup END
324 endif 334
335 augroup VimRCFileType_css
336 au!
337 autocmd BufNewFile,BufRead *.less setlocal filetype=less
338 autocmd Filetype less,css setlocal foldmethod=marker
339 autocmd Filetype less,css setlocal foldmarker={,}
340 autocmd Filetype less,css setlocal iskeyword+=-
341 autocmd Filetype less,css setlocal omnifunc=csscomplete#CompleteCSS
342 augroup END
343
344 augroup VimRCFileType_python
345 au!
346 autocmd FileType python setlocal define=\\v^\\s*(def\|class)\\s+
347 "autocmd FileType python if exists('python_space_error_highlight')|unlet python_space_error_highlight|endif
348 augroup END
349
350 augroup VimRCTrailingWhitespaces
351 au!
352 autocmd FileType c,cpp,java,php,ruby,python,js,css,less autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
353 augroup END
325 354
326 " }}} 355 " }}}
327 356
328 " Mappings {{{ 357 " Mappings {{{
329 358
398 nnoremap <C-l>s :call <SID>ToggleSpellCheck()<cr> 427 nnoremap <C-l>s :call <SID>ToggleSpellCheck()<cr>
399 428
400 " Simple way to close a buffer without closing the window. 429 " Simple way to close a buffer without closing the window.
401 nnoremap <leader>bd :bprevious<cr>:bdelete #<cr> 430 nnoremap <leader>bd :bprevious<cr>:bdelete #<cr>
402 431
403 " Toggle folds with <space>.
404 nnoremap <space> za
405
406 " Create folds with <space> (in visual mode).
407 vnoremap <space> zf
408
409 " File-type switching. 432 " File-type switching.
410 nnoremap <leader>ftmd :set ft=markdown<cr> 433 nnoremap <leader>ftmd :set ft=markdown<cr>
411 434
412 " Use sane regexes. 435 " Use sane regexes.
413 nnoremap / /\v 436 nnoremap / /\v
439 nnoremap N Nzzzv 462 nnoremap N Nzzzv
440 463
441 " Same when jumping around 464 " Same when jumping around
442 nnoremap g; g;zz 465 nnoremap g; g;zz
443 nnoremap g, g,zz 466 nnoremap g, g,zz
467
468 " }}}
469
470 " Folding {{{
471
472 " Always start with all folds closed.
473 set foldlevelstart=0
474
475 " Toggle folds with <space>.
476 nnoremap <space> za
477
478 " Create folds with <space> (in visual mode).
479 vnoremap <space> zf
444 480
445 " }}} 481 " }}}
446 482
447 " Abbreviations {{{ 483 " Abbreviations {{{
448 484
573 endif 609 endif
574 endfunction 610 endfunction
575 611
576 " }}} 612 " }}}
577 613
578 " Temporary stuff {{{
579
580 " Enable debugging Lawrencium
581 let g:lawrencium_debug = 1
582 let g:lawrencium_trace = 0
583
584 command! LawrenciumEnableTrace :call lawrencium#debugtrace(1)
585 command! LawrenciumDisableTrace :call lawrencium#debugtrace(0)
586
587 let g:autotags_debug = 1
588
589 " Enable debugging PieCrust
590 let g:piecrust_debug = 1
591 let g:piecrust_trace = 0
592
593 " }}}
594
595 " Local override {{{ 614 " Local override {{{
596 615
597 let s:local_vimrc = s:vim_home.'/vimrc-local' 616 let s:local_vimrc = s:vim_home.'/vimrc-local'
598 if filereadable(s:local_vimrc) 617 if filereadable(s:local_vimrc)
599 execute 'source' s:local_vimrc 618 execute 'source' s:local_vimrc