X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=vimrc;h=a3163f81e1275616f5174ee3096aac05c37ffb8d;hb=e6c10ad7585aaaa621f3b9b9850704341ac72b8d;hp=985042c13bc666a172f8c2e67400062ef55562f2;hpb=850e6eac79251c87e098359a4f086e7d4f5814cc;p=config%2Fdotfiles.git diff --git a/vimrc b/vimrc index 985042c..a3163f8 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 @@ -136,6 +133,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 @@ -145,14 +148,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 @@ -165,6 +170,16 @@ let NERDCreateDefaultMappings = 0 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