Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mappings to scroll diff buffer without leaving list of commits #55

Open
minusf opened this issue Oct 24, 2018 · 1 comment
Open

mappings to scroll diff buffer without leaving list of commits #55

minusf opened this issue Oct 24, 2018 · 1 comment

Comments

@minusf
Copy link

minusf commented Oct 24, 2018

It would be nice to be able to scroll in the diff buffer without leaving the list of commits.

@sodapopcan
Copy link

sodapopcan commented Feb 8, 2019

@minusf I asked for similar behaviour in vim-plug. Junegunn offered this solution.

Here is a modified version of it to work with gv.vim for your .vimrc:

function! s:scroll_commits(down) abort
  wincmd p
  execute 'normal!' a:down ? "\<c-e>" : "\<c-y>"
  wincmd p
endfunction

function! s:init_gv_scroll() abort
  nnoremap <silent> <buffer> J :call <sid>scroll_commits(1)<cr>
  nnoremap <silent> <buffer> K :call <sid>scroll_commits(0)<cr>
endfunction

augroup GVextras
  autocmd!
  autocmd FileType GV call s:init_gv_scroll()
augroup END

Change J and K to taste.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants