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.
0 votes
in vifm by

I'd like to toggle visual mode by pressing e and see it display the file contents on the entire screen, not just half of it. Of course, I could map :!less %c <cr> to e, but that doesn't allow me to toggle with e.

1 Answer

0 votes
by

I think you mean view mode, not visual mode. Something like this could do it:

nnoremap e :only|normal e<cr>
qnoremap e q:vsplit<cr>

With current version one should be able to restore exact split state, but this needs functions that were added after 0.8.

Of course, I could map :!less %c to e, but that doesn't allow me to toggle with e.

This can be done with less actually, if you create ~/.lesskey:

#command
e quit

and then run lesskey to generate ~/.less from ~/.lesskey. See man lesskey.

by

I like the first solution, but it breaks when :view is enabled.

by

It's easy to come up with an awful workaroung:

nnoremap e :view!|view|only|normal e<cr>
qnoremap e q:vsplit<cr>
by

Awful indeed. I'll just use less instead.

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.
...