2

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.

ExistMe
  • 509
  • 6
  • 18
  • @xaizek do you possibly now the answer to this question? I tried to go through the source code in vifm git repo but couldn't find out any solution. – ExistMe Aug 17 '16 at 17:03
  • 2
    Looks like @-references don't work if you didn't comment on the question, I didn't get notification. Both commands you tried should work, it's [in the code](https://github.com/vifm/vifm/blob/67aa86d1eb5ecc679e4b30bc4e114aef78cd5e5a/src/modes/normal.c#L817-L824). Mind that it was added in 0.8.1, do you have this or newer version? – xaizek Aug 17 '16 at 20:46
  • 1
    Thanks a lot @xiazek. You were right. the vifm version which was installed by apt-get on raspberry was too old. Built it from the repo and it works as the manual says. Could you please re-post your comment as an answer so I could mark it as the solution? – ExistMe Aug 20 '16 at 02:56

1 Answers1

2

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.

xaizek
  • 5,098
  • 1
  • 34
  • 60