aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/diff.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-22 22:31:27 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-22 22:31:27 +1200
commitee573778521c6e9af919d60861bc519e7538193d (patch)
tree3350fadc3177475aaa29d0bd6239f0115d24102b /vim/after/ftplugin/diff.vim
parentTurn 'hidden' on for a bit (diff)
downloaddotfiles-ee573778521c6e9af919d60861bc519e7538193d.tar.gz
dotfiles-ee573778521c6e9af919d60861bc519e7538193d.zip
Add Vim mappings for normal {,} in diff buffers
Diffstat (limited to 'vim/after/ftplugin/diff.vim')
-rw-r--r--vim/after/ftplugin/diff.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/vim/after/ftplugin/diff.vim b/vim/after/ftplugin/diff.vim
index 1e2bb2f8..109b5b49 100644
--- a/vim/after/ftplugin/diff.vim
+++ b/vim/after/ftplugin/diff.vim
@@ -8,6 +8,12 @@ if exists('g:no_plugin_maps') || exists('g:no_diff_maps')
finish
endif
+" Modify curly braces to navigate by diff block
+nnoremap <buffer> { ?^@@<CR>
+nnoremap <buffer> } /^@@<CR>
+let b:undo_ftplugin .= '|nunmap <buffer> {'
+ \ . '|nunmap <buffer> }'
+
" Set mappings
nmap <buffer> <LocalLeader>p <Plug>(DiffPrune)
xmap <buffer> <LocalLeader>p <Plug>(DiffPrune)