vifm: Fix view mapping always entering view window

Simplified the view mapping (`w`) to not 'enter' the view window that is
opened by default.

What happened previously is that pressing the mapping
would open the view pane (or create a vertical/horizontal split and then
open the view pane within it if only one pane is visible) and then move
the cursor into it so that you can scroll within.
The issue was that to close the view pane again, one had to exit it
first (through `Shift+w`) which really hurt the quick-glance into a file
and then move on kind of workflow I mostly use previews for.

This commit simplifies the view mapping to allow exactly that, pressing
`w` still does all the things it did previously, only does not move
focus into the preview window so keeps the workflow simpler.
This commit is contained in:
Marty Oehme 2023-06-22 11:36:32 +02:00
parent 1665dd6cf6
commit c8a2236a1c
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -298,15 +298,11 @@ nnoremap ,t :!vifm-thumbnailer -t %u %c<cr>
nnoremap ,T :!vifm-thumbnailer -r -t %u %c<cr>
" allows preview to work for normal view and single pane view
noremap <silent> w : if &quickview && !layoutis('only')
noremap <silent> w : if layoutis('only')
\| if &lines + 50 < &columns | vsplit | else | split | endif
\| 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'
\| view
\| endif
\| <cr>
@ -429,21 +425,10 @@ filetype *.o nm %f | less
filetype *.[1-8] man ./%c
fileviewer *.[1-8] man ./%c | col -b
" Gif
filextype *.gif
\ {View in viu}
\ viu --once --name %f; read -k 1 -s -r,
\ {Loop}
\ mpv --loop=inf %f %i &,
fileviewer *.gif
\ kitty +kitten icat --silent --transfer-mode=stream --place=%pwx%ph@%pxx%py %c %N
\ %pc
\ kitty +kitten icat --clear --silent %pd
" Images
filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
\ {View in viu}
\ viu --name %f; read -k 1 -s -r,
\ viu --once --name %f; read -k 1 -s -r,
\ {View in nsxiv directory viewer}
\ vifm-thumbnailer %c,
\ {View in imv}
@ -459,7 +444,7 @@ filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
\ {View in gpicview}
\ gpicview %c,
fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
\ viu -b -w %pw -h %ph %c
\ viu -b -w %pw -h %ph -s %c
" OpenRaster
filextype *.ora