Mappings for gundo plugin.
[profile.git] / .vimrc
diff --git a/.vimrc b/.vimrc
index a76c6a0..0bb5efb 100644 (file)
--- a/.vimrc
+++ b/.vimrc
@@ -1339,6 +1339,9 @@ call Mapping("u", ":call <SID>Cycle_Undo()<CR>:<CR>")
 " Remove persistent undo file with \U.
 call Mapping("U", ":call <SID>Clear_Undo()<CR>:<CR>")
 
+" Toggle gundo window with \g.
+call Mapping("g", ":call gundo#GundoToggle()<CR>:<CR>")
+
 " Use a persistent undo file if it exists.
 fun! <SID>Check_Undo() "{{{2
   if filereadable(undofile(expand("%")))
@@ -1414,6 +1417,12 @@ if has("autocmd")
     au Display WinEnter * if &diff | se cursorbind | endif
   endif
 endif
+
+" Mapping to reload the gundo window.
+if has("autocmd")
+  au Mode BufEnter * if &ft == "gundo" | try | nnoremap <silent> <buffer> <unique> r :call gundo#GundoToggle()<CR>:call gundo#GundoToggle()<CR> | catch | endtry | endif
+endif
+
 endif "}}}1
 
 " Resize after startup.