mirror of
https://github.com/junegunn/vim-plug.git
synced 2025-12-06 09:04:23 +08:00
Add <plug>(plug-preview) map (#769)
This allows you to override the default behavior of `o' or `<cr>'
binding in PlugDiff window.
e.g.
" Move to preview window
autocmd! FileType vim-plug nmap <buffer> o <plug>(plug-preview)<c-w>P
Close #749
Close #768
This commit is contained in:
@@ -370,8 +370,15 @@ Execute (New commits on remote, PlugUpdate, then PlugDiff):
|
||||
AssertEqual 1, &previewwindow
|
||||
AssertEqual 'git', &filetype
|
||||
|
||||
" Back to plug window
|
||||
wincmd p
|
||||
" Close preview window
|
||||
pclose
|
||||
|
||||
" Open and go to preview window with a custom mapping
|
||||
nmap <buffer> <c-o> <plug>(plug-preview)<c-w>P
|
||||
execute "normal \<c-o>"
|
||||
AssertEqual 1, &previewwindow, 'Should be on preview window'
|
||||
normal q
|
||||
AssertEqual 0, &previewwindow, 'Should not be on preview window'
|
||||
|
||||
" ]] motion
|
||||
execute 'normal $]]'
|
||||
|
||||
Reference in New Issue
Block a user