Search code examples
vifm

Is there a command to set the splitter position in vifm?


I know that there are commands and shortcuts for increasing/decreasing or maximaizing the pane size in vifm but I wonder if there is one for setting it to a specific size?

The documentation on vifm manual page says:

Ctrl-W | 
         set current view size to count.
Ctrl-W _
         set current view size to count.

But no matter what I use (like 30<c-w>| or <c-w>30|) it doesn't do anything and only maximizes the current pane.

I want to define a mapping which goes to preview mode and will set the first pane to 30 characters width and the second pane to be maximized and be in preview mode. Right now the only solution I found, is something like this:

nnoremap <c-f> <c-w>h<c-w>=30<c-w>-<esc>:view!<cr><s-tab>

but this will cause a flicker on screen, since first it tries to make the panes equal and then decreases the first pane.


Solution

  • Both 30<c-w>| and <c-w>30| are valid commands in versions starting from 0.8.1, but in previous versions count was ignored and | could only maximize the current pane.

    Keep in mind that online version of documentation describes the latest release version, which might not be what you have installed in your system. Thus cross checking with man vifm might be a good idea if something doesn't work as described online.