Is there a function to ensure (or at least try) that a given window has a height of N lines, by shrinking it (or enlarging it) as needed?

  • If N is too much (or not enough) for a given scenario, then a reaching best-effort value of M lines is ok.
  • It's safe to assume that there are multiple, stacked windows (one is above the other, instead of side to side)

1 Answer 1


If you have 1 window in a frame the only way is shrink frame itself.

If you have many windows it could be impossible to ensure height of the particular window due to minimal height restriction.

So what is the usecase? Whenever you split vertically to have one of the window N lines if possible? Then use (split-window-vertically 10), it will create 2 windows, the top one with 10 rows, the bottom one with the rest.

  • Questioning the original question rarely tends to be a useful answer, and would have been better expressed as a comment. I've edited my question.
    – deprecated
    Commented Sep 28, 2018 at 8:22
  • @vemv, Really sorry to make you unhappy with my answer not expressed as a comment. Peace.
    – Maxim Kim
    Commented Sep 28, 2018 at 8:27
  • 1
    ✌️ Basically it's how SE works. Anyway pointing out to the optional split-window-vertically was spot on - by passing it a negative argument I can solve my original problem. Thanks!
    – deprecated
    Commented Sep 28, 2018 at 8:30
  • FYI it's not about me getting offended, it's about giving me the possibility to reply in a reasonable format. Hard to reply point-by-point to an pseudo-answer in a comment. Hope it's useful!
    – deprecated
    Commented Sep 28, 2018 at 8:34
  • 1
    NP, I actually had the same in mind -- reasonable formatting. A couple of times I did comments that were messy.
    – Maxim Kim
    Commented Sep 28, 2018 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.