changeset 210:477efa0013fd

Merge changes.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 01 Sep 2014 08:47:21 -0700
parents a903bd42d8d9 (current diff) 4bd15b5afcfc (diff)
children 413c0ddff4e8
files vim/vimrc
diffstat 1 files changed, 70 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/vim/vimrc	Mon Sep 01 08:42:49 2014 -0700
+++ b/vim/vimrc	Mon Sep 01 08:47:21 2014 -0700
@@ -250,9 +250,6 @@
 
 " Use `pyflakes` with `syntastic`.
 "let g:syntastic_python_checkers = ['pyflakes']
-"let g:syntastic_mode_map = {
-"            \'mode': 'active',
-"            \'passive_filetypes': []}
 
 " }}}
 
@@ -284,7 +281,20 @@
 
 " Python-Mode {{{
 
-let g:pymode = 0
+let g:pymode = 1
+let g:pymode_python = 'disable'
+let g:pymode_syntax_all = 1
+let g:pymode_syntax_print_as_function = 1
+let g:pymode_syntax_space_errors = 1
+let g:pymode_run = 0
+let g:pymode_lint = 0
+let g:pymode_trim_whitespaces = 0
+let g:pymode_virtualenv = 0
+let g:pymode_folding = 1
+
+if !has('python')
+    let g:pymode = 0
+endif
 
 " }}}
 
@@ -292,36 +302,55 @@
 
 " File-Specific Settings {{{
 
-if has("autocmd")
-
-    augroup VimRCAutoCWD
-        au!
+" Automatically change the current working directory based on a project
+" I'm in.
+augroup VimRCAutoCWD
+    au!
+    autocmd BufEnter * call s:SetProjectRootCwd()
+augroup END
 
-        autocmd BufEnter * call s:SetProjectRootCwd()
-    augroup END
+augroup VimRCFileType_markdown
+    au!
+    autocmd FileType text,markdown setlocal textwidth=80
+    autocmd FileType markdown nnoremap <buffer> <localleader>1 yypVr=:redraw<cr>
+    autocmd FileType markdown nnoremap <buffer> <localleader>2 yypVr-:redraw<cr>
+    autocmd FileType markdown nnoremap <buffer> <localleader>3 mzI###<space><esc>`z4l
+    autocmd FileType markdown nnoremap <buffer> <localleader>4 mzI####<space><esc>`z5l
 
-    augroup VimRCFileTypeSettings
-        au!
-    
-        " Nice text width for text files.
-        autocmd FileType text,markdown setlocal textwidth=80
+    autocmd BufRead,BufNewfile */Dropbox/Personal/SimpleNote/* set ft=markdown
+    autocmd BufRead,BufNewFile */_content/**/*.html set ft=piecrustmarkdown
+augroup END
+
+augroup VimRCFileType_php
+    au!
+    " Who the hell changes my matchpairs?
+    autocmd FileType php setlocal matchpairs-=<:>
+augroup END
 
-        " Who the hell changes my matchpairs?
-        autocmd FileType php setlocal matchpairs-=<:>
-
-        " File I know are markdown: personal notes & PieCrust pages.
-        autocmd BufRead,BufNewfile */Dropbox/Personal/SimpleNote/* set ft=markdown
-        autocmd BufRead,BufNewFile */_content/**/*.html set ft=piecrustmarkdown
+augroup VimRCFileType_c
+    au!
+    autocmd FileType c,c++ setlocal foldmethod=marker foldmarker={,}
+augroup END
 
-    augroup END
-
-    augroup VimRCTrailingWhitespaces
-        au!
+augroup VimRCFileType_css
+    au!
+    autocmd BufNewFile,BufRead *.less setlocal filetype=less
+    autocmd Filetype less,css setlocal foldmethod=marker
+    autocmd Filetype less,css setlocal foldmarker={,}
+    autocmd Filetype less,css setlocal iskeyword+=-
+    autocmd Filetype less,css setlocal omnifunc=csscomplete#CompleteCSS
+augroup END
 
-        autocmd FileType c,cpp,java,php,ruby,python,js,css,less autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
-    augroup END       
+augroup VimRCFileType_python
+    au!
+    autocmd FileType python setlocal define=\\v^\\s*(def\|class)\\s+
+    "autocmd FileType python if exists('python_space_error_highlight')|unlet python_space_error_highlight|endif
+augroup END
 
-endif
+augroup VimRCTrailingWhitespaces
+    au!
+    autocmd FileType c,cpp,java,php,ruby,python,js,css,less autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
+augroup END       
 
 " }}}
 
@@ -400,12 +429,6 @@
 " Simple way to close a buffer without closing the window.
 nnoremap <leader>bd :bprevious<cr>:bdelete #<cr>
 
-" Toggle folds with <space>.
-nnoremap <space> za
-
-" Create folds with <space> (in visual mode).
-vnoremap <space> zf
-
 " File-type switching.
 nnoremap <leader>ftmd :set ft=markdown<cr>
 
@@ -444,6 +467,19 @@
 
 " }}}
 
+" Folding {{{
+
+" Always start with all folds closed.
+set foldlevelstart=0
+
+" Toggle folds with <space>.
+nnoremap <space> za
+
+" Create folds with <space> (in visual mode).
+vnoremap <space> zf
+
+" }}}
+
 " Abbreviations {{{
 
 iabbrev @@      ludovic@chabant.com
@@ -575,23 +611,6 @@
 
 " }}}
 
-" Temporary stuff {{{
-
-" Enable debugging Lawrencium
-let g:lawrencium_debug = 1
-let g:lawrencium_trace = 0
-
-command! LawrenciumEnableTrace  :call lawrencium#debugtrace(1)
-command! LawrenciumDisableTrace :call lawrencium#debugtrace(0)
-
-let g:autotags_debug = 1
-
-" Enable debugging PieCrust
-let g:piecrust_debug = 1
-let g:piecrust_trace = 0
-
-" }}}
-
 " Local override {{{
 
 let s:local_vimrc = s:vim_home.'/vimrc-local'