X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=vimrc;h=3fa27cb13e0756a06246854d8d5d6f4f62be66e5;hb=51bdb20b6c613f6b29b1e59d6077743b0ce2da6d;hp=6e418649e4614f92f96b12a41da0f65ebbeaa9c9;hpb=ca462be37e2015ee7dc289969c6b5da81e545687;p=config%2Fdotfiles.git diff --git a/vimrc b/vimrc index 6e41864..3fa27cb 100644 --- a/vimrc +++ b/vimrc @@ -223,6 +223,14 @@ cmap cnoremap cnoremap +" Write before suspending, thanks to deryni in #vim on Freenode (2011-05-09 +" 20:02 CEST). To suspend without saving either unmap it or use :stop. +nnoremap :update:stop + +" 2 gives more verbose information, use it by default. Thanks to NCS_One +" in #vim on Freenode (2011-08-15 00:17 CEST). +nnoremap 2 + " Use to move down a page and - to move up one like in mutt. nnoremap nnoremap - @@ -337,7 +345,9 @@ if has('syntax') " Don't highlight more than 500 columns as I normally don't have that long " lines and they slow down syntax coloring. Thanks to Derek Wyatt " (http://www.derekwyatt.org/vim/the-vimrc-file/). - set synmaxcol=500 + if exists('+synmaxcol') + set synmaxcol=500 + endif " Highlight lines longer than 78 characters. Thanks to Tony Mechelynck " from the Vim mailing list. It can easily be @@ -352,6 +362,15 @@ if has('syntax') if v:version > 701 || (v:version == 701 && has('patch42')) call matchadd('Todo', '\(TODO\|FIXME\|CHANGED\|XXX\)') endif + +" Settings for specific filetypes. + + " Perl. + let g:perl_fold = 1 + let g:perl_fold_blocks = 1 + let g:perl_nofold_packages = 1 + let g:perl_include_pod = 1 " syntax coloring for PODs + endif @@ -360,8 +379,8 @@ endif " Use pathogen which allows one 'runtimepath' entry per plugin. This makes " installing/removing/updating plugins simple. (Used for plugins with more " than one file.) -if has('eval') - call pathogen#runtime_append_all_bundles() +if has('eval') && v:version >= 700 + execute 'call pathogen#runtime_append_all_bundles()' endif " Settings for the NERD commenter. @@ -414,7 +433,9 @@ if has('autocmd') " Automatically disable 'paste' mode when leaving insert mode. Thanks to " Raimondi in #vim on Freenode (2010-08-14 23:01 CEST). Very useful as I only " want to paste once and then 'paste' gets automatically unset. - autocmd InsertLeave * set nopaste + if exists('#InsertLeave') + autocmd InsertLeave * set nopaste + endif " AFTER/FTPLUGIN AUTO COMMANDS @@ -431,9 +452,6 @@ if has('autocmd') " the recommendation for git commit messages (http://tpope.net/node/106). autocmd FileType gitcommit let g:secure_modelines_allowed_items = [] | \ setlocal textwidth=72 -" Allow folding in perl. - autocmd FileType perl let perl_fold = 1 | - \ let perl_fold_blocks = 1 " Use the same comment string as for Vim files in Vimperator files. autocmd FileType vimperator setlocal commentstring=\"%s