]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - vimrc
Add crontab after syntax for better spell checking.
[config/dotfiles.git] / vimrc
diff --git a/vimrc b/vimrc
index 1f14e5f23944c073c9da799994db26a210b793dc..a3163f81e1275616f5174ee3096aac05c37ffb8d 100644 (file)
--- a/vimrc
+++ b/vimrc
@@ -148,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
 " <antoine.mechelynck@gmail.com> 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 +168,18 @@ endif
 let NERDCreateDefaultMappings = 0
 " Map toggle comment.
 map <Leader><Leader> <plug>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