Last active
December 21, 2015 13:09
-
-
Save qstrahl/6310563 to your computer and use it in GitHub Desktop.
Better, default-compatible mappings for diff mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"" Override default diff normal commands to allow count specifying which diffed window to target | |
nno do :<C-U>exe 'diffget' v:count ? get(filter(tabpagebuflist(), 'getbufvar(bufname(v:val), "&diff")'), v:count) : '' '<Bar> diffupdate'<CR> | |
nno dp :<C-U>exe 'diffput' v:count ? get(filter(tabpagebuflist(), 'getbufvar(bufname(v:val), "&diff")'), v:count) : '' '<Bar> diffupdate'<CR> | |
"" Add a shortcut to :diffupdate | |
nnoremap du :<C-U>diffupdate<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment