X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=vimrc;h=b6e1cbb3537c58af7bd9d58e5f8f0643ce756da7;hb=5ed3e6040ece53a2132ebec1dcfe2d7df0356ad1;hp=1f14e5f23944c073c9da799994db26a210b793dc;hpb=1c46e36badce4692e1ce044ccaa79e68b042f6fc;p=config%2Fdotfiles.git diff --git a/vimrc b/vimrc index 1f14e5f..b6e1cbb 100644 --- a/vimrc +++ b/vimrc @@ -113,6 +113,11 @@ nnoremap - map se :set spelllang=en_us map sd :set spelllang=de_de +" Add semicolon to the end of the line. Thanks to +" http://www.van-laarhoven.org/vim/.vimrc for this idea and godlygeek in #vim +" for an improved version which doesn't clobber any marks. +nnoremap ; :call setline(line('.'), getline('.') . ';') + " I often type "W" instead of "w" when trying to save a file. Fix my mistake. " Thanks to Tony Mechelynck from the Vim " mailing list for the commands. @@ -148,14 +153,16 @@ endif " SYNTAX SETTINGS " Activate syntax coloring. -syntax enable +if has("syntax") + syntax enable " Highlight text longer then 78 characters. Thanks to Tony Mechelynck " from the Vim mailing list. -if v:version >= 700 - 2match Todo /\%>78v./ -else - match Todo /\%>78v./ + if v:version >= 700 + 2match Todo /\%>78v./ + else + match Todo /\%>78v./ + endif endif @@ -166,3 +173,18 @@ endif let NERDCreateDefaultMappings = 0 " Map toggle comment. map NERDCommenterToggle + + +" AUTO COMMANDS + +" Use a custom auto group to prevent problems when the vimrc files is sourced +" twice. +if has("autocmd") + augroup vimrc + autocmd! + +" Use diff filetype for mercurial patches in patch queue. + autocmd BufReadPost */.hg/patches/* set filetype=diff + + augroup END +endif