Difference between revisions of "Single-pane preview"

From Vifm Wiki
Jump to navigation Jump to search
(Add single-pane preview snippet)
 
 
(One intermediate revision by one other user not shown)
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

Latest revision as of 20:27, 20 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