Single-pane preview

From Vifm Wiki
Jump to: navigation, search

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