Difference between revisions of "Single-pane preview"
Jump to navigation
Jump to search
(Add single-pane preview snippet) |
m |
||
Line 1: | Line 1: | ||
This snippet allows single-click previews with only one pane visible: | This snippet allows single-click previews with only one pane visible: | ||
<source lang="vim"> | <source lang="vim"> | ||
− | w | + | nnoremap <silent> w : if &quickview && !layoutis('only') |
+ | \| view | ||
+ | \| else | ||
+ | \| if layoutis('only') | ||
+ | \| if &lines + 50 < &columns | vsplit | else | split | endif | ||
+ | \| endif | ||
+ | \| view! | ||
+ | \| execute 'qnoremap w q:view|only|qunmap w<lt>cr>' | ||
+ | \| execute 'wincmd w' | ||
+ | \| endif | ||
+ | \| <cr> | ||
</source> | </source> | ||
Context: https://q2a.vifm.info/803/file-preview-when-in-the-single-pane-mode | Context: https://q2a.vifm.info/803/file-preview-when-in-the-single-pane-mode |
Revision as of 23:01, 10 February 2021
This snippet allows single-click previews with only one pane visible:
nnoremap <silent> w : if &quickview && !layoutis('only')
\| view
\| else
\| if layoutis('only')
\| if &lines + 50 < &columns | vsplit | else | split | endif
\| endif
\| view!
\| execute 'qnoremap w q:view|only|qunmap w<lt>cr>'
\| execute 'wincmd w'
\| endif
\| <cr>
Context: https://q2a.vifm.info/803/file-preview-when-in-the-single-pane-mode