1

I use :vs to open a window. If I want this window to be the leftmost window, no matter what the currently active window is, how can I do it?

  • 3
    You cannot really change the behavior of :vs to do what you want. I myself just do <C-w>v<C-w>H. But more single-minded way would be :vert topleft split – klaus Aug 24 at 11:32
  • 2
    @klaus This is an answer, please turn it into one. You can use :topleft :vsplit, no need to switch to :vert. Also <C-w>H on its own after :vs, no need to switch to <C-w>v for that to work either. But it's still an answer, please post it as such. – filbranden Aug 24 at 15:44
  • 1
    @filbranden, thanks. I posted an answer, including your suggestions. I actually didn't know :topleft was a {cmd} modifier, maybe cause it is only and specifically useful for splitting windows; and I personally do that with keybindings, not commands. That's why I suggested <C-w>v instead of :vs: it wasn't an answer and I was talking about my personal workflow. Anyway, thanks for the suggestions, and please, if you have time, check if the answer is correct. – klaus Aug 24 at 16:26
  • 1
    @klaus Yes it was good. I edited it to remove the references to :vert (that's not really relevant here), rephrased it a little bit and added links to the help pages. Let me know if you disagree with any of the edits. Thanks for answering! – filbranden Aug 24 at 16:53
2

You can use a couple of methods to achieve the same end result as your request.

  • You can just open a vertical split and then move it to leftmost position using Controlw + ShiftH (note that the "h" is uppercase.) See :help CTRL-W_H for more information.

  • You can use :topleft to modify your :vs command to open the window in the leftmost position. You can use the following command for that:

    :topleft vs
    

Your Answer

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

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