1

Let's say I have two windows open, stacked one above the other (via vim -o file1 file2 or :split).

Is there a command (sequence) which would allow me to turn this into two windows that are side by side (as via vim -O file1 file2 or :vsplit)?

More generally speaking, is there a command (sequence) to turn the currently displayed windows on the side?

2

Move one of the windows to the side, with CtrlWShiftH or CtrlWShiftL:

                                                CTRL-W_H
CTRL-W H        Move the current window to be at the far left, using the
                full height of the screen.  This works like closing the
                current window and then creating another one with
                ":vert topleft split", except that the current window contents
                is used for the new window.
                {not available when compiled without the |+vertsplit| feature}

                                                CTRL-W_L
CTRL-W L        Move the current window to be at the far right, using the full
                height of the screen.  This works like closing the
                current window and then creating another one with
                ":vert botright split", except that the current window
                contents is used for the new window.
                {not available when compiled without the |+vertsplit| feature}

Note that the H is a capital here, the lowercase h simply moves the cursor to the other window instead of moving the window itself.

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.