]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - vimrc
Fix inserting xa0 on Mac.
[config/dotfiles.git] / vimrc
diff --git a/vimrc b/vimrc
index 631c84405a266078608de28c8243b7b2c124bc88..e44b0217d50d37d2431069f16286d27d3532b8b7 100644 (file)
--- a/vimrc
+++ b/vimrc
@@ -136,6 +136,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 <Char-0xa0> <Space>
+endif
+
 " Disable Apple style movements in MacVim.
 if has("gui_macvim")
     let macvim_skip_cmd_opt_movement = 1
@@ -147,6 +153,14 @@ endif
 " Activate syntax coloring.
 syntax enable
 
+" Highlight text longer then 78 characters. Thanks to Tony Mechelynck
+" <antoine.mechelynck@gmail.com> from the Vim mailing list.
+if v:version >= 700
+    2match Todo /\%>78v./
+else
+    match Todo /\%>78v./
+endif
+
 
 " PLUGIN SETTINGS