add remapping options for graph navigation keys

This commit is contained in:
Nathan Howell 2011-02-27 15:53:34 -08:00
parent 8de0b4ce47
commit 2677c0a07f
2 changed files with 20 additions and 2 deletions

View File

@ -14,6 +14,8 @@ CONTENTS *Gundo-contents*
3.4 gundo_right ............... |gundo_right|
3.5 gundo_help ................ |gundo_help|
3.6 gundo_disable ............. |gundo_disable|
3.7 gundo_map_move_older ...... |gundo_map_move_older|
gundo_map_move_newer ...... |gundo_map_move_newer|
4. License ........................ |GundoLicense|
5. Bugs ........................... |GundoBugs|
6. Contributing ................... |GundoContributing|
@ -176,6 +178,16 @@ them may not have Python support.
Default: 0 (Gundo is enabled as usual)
------------------------------------------------------------------------------
3.7 g:gundo_map_move_older,g:gundo_map_move_newer *gundo_map_move_older*
*gundo_map_move_newer*
These options let you change the keys that navigate the undo graph. This is
useful if you use a Dvorak keyboard and have changed your movement keys.
Default: gundo_map_move_older = "j"
gundo_map_move_newer = "k"
==============================================================================
4. License *GundoLicense*

View File

@ -426,10 +426,16 @@ endfunction"}}}
"{{{ Gundo buffer settings
function! s:GundoMapGraph()"{{{
if !exists("g:gundo_map_move_older")
let g:gundo_map_move_older = 'j'
endif
if !exists("g:gundo_map_move_newer")
let g:gundo_map_move_newer = 'k'
endif
exec 'nnoremap <script> <silent>'.g:gundo_map_move_older." :call <sid>GundoMove(1)<CR>"
exec 'nnoremap <script> <silent>'.g:gundo_map_move_newer." :call <sid>GundoMove(-1)<CR>"
nnoremap <script> <silent> <buffer> <CR> :call <sid>GundoRevert()<CR>
nnoremap <script> <silent> <buffer> o :call <sid>GundoRevert()<CR>
nnoremap <script> <silent> <buffer> j :call <sid>GundoMove(1)<CR>
nnoremap <script> <silent> <buffer> k :call <sid>GundoMove(-1)<CR>
nnoremap <script> <silent> <buffer> <down> :call <sid>GundoMove(1)<CR>
nnoremap <script> <silent> <buffer> <up> :call <sid>GundoMove(-1)<CR>
nnoremap <script> <silent> <buffer> gg gg:call <sid>GundoMove(1)<CR>