]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
Add first autocmd, for mercurial.
authorSimon Ruderich <simon@ruderich.org>
Tue, 17 Feb 2009 13:35:01 +0000 (14:35 +0100)
committerSimon Ruderich <simon@ruderich.org>
Tue, 17 Feb 2009 13:35:01 +0000 (14:35 +0100)
They are only used if autocmd is available.

vimrc

diff --git a/vimrc b/vimrc
index 3d269fa0634e3c84a5ff08547dda922e8503dfbe..a3163f81e1275616f5174ee3096aac05c37ffb8d 100644 (file)
--- a/vimrc
+++ b/vimrc
@@ -168,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