-" Automatically save and the load the file state (stored in ~/.vim/view).
-autocmd BufWrite * mkview
-autocmd BufRead * loadview
+" Settings for the NERD commenter.
+" Don't create any mappings I don't want to use.
+if has("eval")
+ let NERDCreateDefaultMappings = 0
+endif
+" 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