X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=vimrc;h=b6e1cbb3537c58af7bd9d58e5f8f0643ce756da7;hb=5ed3e6040ece53a2132ebec1dcfe2d7df0356ad1;hp=656c6f6c9d75ae59963bbdb688fbbadba25eed9f;hpb=693677286e62bc6bd622d48905766ef63da5acd7;p=config%2Fdotfiles.git diff --git a/vimrc b/vimrc index 656c6f6..b6e1cbb 100644 --- a/vimrc +++ b/vimrc @@ -89,9 +89,6 @@ set listchars=trail:- " EDITOR SETTINGS -" Don't use any modelines. -set nomodeline - " When completing paths first use the longest path then display a list of all " possible files. set wildmode=longest,list @@ -108,10 +105,19 @@ endif let mapleader = "," let maplocalleader = "," +" Use to move down a page and - to move up one like in mutt. +nnoremap +nnoremap - + " Maps to change spell language between English and German. 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. @@ -132,6 +138,12 @@ else \ ((getcmdtype() == ':' && getcmdpos() <= 2) ? 'q' : 'Q') endif +" Make sure xa0 (alt + space) is automatically changed to a normal whitespace +" if pressed accidentally while in insert mode (happens on Mac sometimes). +if has("mac") + imap +endif + " Disable Apple style movements in MacVim. if has("gui_macvim") let macvim_skip_cmd_opt_movement = 1 @@ -141,18 +153,38 @@ 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./ + endif +endif " PLUGIN SETTINGS " Settings for the NERD commenter. " Don't create any mappings I don't want to use. -let NERDCreateDefaultMappings=0 +let NERDCreateDefaultMappings = 0 " Map toggle comment. map NERDCommenterToggle -" Automatically save and the load the file state (stored in ~/.vim/view). -autocmd BufWrite * mkview -autocmd BufRead * loadview +" 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