From 59b3720ea7cf698a8999a5eecfcb508a687cbab3 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 22 Jun 2023 11:36:32 +0200 Subject: [PATCH] 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. --- terminal/.config/vifm/vifmrc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/terminal/.config/vifm/vifmrc b/terminal/.config/vifm/vifmrc index f3d3118..4d48074 100644 --- a/terminal/.config/vifm/vifmrc +++ b/terminal/.config/vifm/vifmrc @@ -298,15 +298,11 @@ nnoremap ,t :!vifm-thumbnailer -t %u %c nnoremap ,T :!vifm-thumbnailer -r -t %u %c " allows preview to work for normal view and single pane view -noremap w : if &quickview && !layoutis('only') +noremap 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 wcr>' - \| execute 'wincmd w' + \| view \| endif \| @@ -459,7 +455,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 + \ env -u COLORTERM viu -w %pw -h %ph -s %c " OpenRaster filextype *.ora