Is there any way to get the position of the top left corner of a split window relative to the entire vim window? For example, if there was only one window, and the tabline was inactive, the position would be 1,1. But, if the tabline was active, and there was another split window that was 10 characters wide to the left of the current window, the position would be 11,2. Is there any way to figure this out?

  • 3
    :h win_screenpos()
    – Matt
    Jan 24, 2021 at 15:47
  • Thanks! This is exactly what I was looking for.
    – Prismavoid
    Jan 24, 2021 at 15:56

1 Answer 1


As Matt mentioned in a comment, win_screenpos(window number) returns a list with the x and y position of the window.

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.