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.

Keep selection after entering and going back from viewer

+1 vote
asked Jul 23, 2016 in vifm by tagwint

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

0 votes
answered Jul 23, 2016 by xaizek
selected Jul 23, 2016 by tagwint
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.

commented Jul 23, 2016 by tagwint

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

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.