I've searched high and low for this information but have had no luck.

I've recently purchased a very wide monitor, and essentially what I want to do is not have every vim vertical split be an exact % of my monitor width: I want to stack reasonably sized vim splits to the left, and then just expand the number as I need them.

I often find myself with 4 or 5 splits open, and in that case, my monitor is perfect! It's when two are open it's annoying.

Has anyone seen any solution to this or can think of an easy way to do it?

Many thanks.

(oh, I'm using neovim if that's at all relevant, on a mac, with Alacritty)

  • 1
    I’m not sure I follow your desired layout. If possible, maybe a sketch/drawing/animation/whatever will help? OTOH, are you aware that you can resize any window however you want?
    – D. Ben Knoble
    Dec 17 '21 at 18:20
  • Hi, thanks for your reply. I'll do a sketch or something tomorrow but to answer your OTOH - I can resize a split when there are two or more, but, for instance, could I resize a split when there is only one? I know it seems non-sensical, but could you do it? Give it, to use a css example, margin: auto. Dec 17 '21 at 23:12
  • In fact, the CSS example is a good one. What I want to do, in essence, is give every vim split a fixed width (say 100 characters) and float: left. Whenever I make a new split, it sits to the right of the existing ones, at 100 characters width. Dec 17 '21 at 23:13
  • If I understand correctly, you kinda want 4 splits at anytime even when they show no buffer, so even with a single opened file, one line is not a meter wild. Maybe formatting :h gq, or goyo could help. Also see winfixwidth for explicitly setting a width that should not change automatically.
    – Biggybi
    Dec 18 '21 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.