Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
+2 votes
in vifm by

One of possible use case:
If I do some specific manual selection, marking files with t I may need to check the content of the file, when i exit viewer, selection is gone. How can I keep selection permanently?

1 Answer

+1 vote
by
selected by
 
Best answer

Assuming you're talking about :view, which is by default mapped to w key, you might want to change this mapping in vifmrc:

nnoremap w :view<cr>

to this:

nnoremap w :view<cr>gs

which will restore selection after command is executed.

It's not the viewer which resets the selection, but rather execution of most command-line commands behave this way. Introduction of a prefix command that disables resetting of selection was once discussed, maybe it's worth adding such a command.

by

Hey, gs is good point indeed, I should have noticed it earlier.
Just too new to vifm. Thank you for prompt reply.

by

Yes, a prefix command to disable resetting of selection would be super useful. Can this be added please?

by

I haven't tried adding it, need to see whether it has any undesired consequences for processing selection.

by

Thank you. This is very important in my workflow (and I see for others from this post and others.). I would be more than happy to test if/when there is any changes that you want to test.

...