

Press Ctrl + w key combination and then press the " +" (plus) symbol to increase the height of the current window.To resize a window, use either of the following methods: So, let's go over how you can resize the split windows in Vim. It is good for my OCD, but not really productive when I have a file that I edit most of the time and another file that I rarely edit. Move to the split window on the right: press Ctrl + w and press līy default, Vim creates splits with a similar width/height.Move to the split window on the up: press Ctrl + w and press k.Move to the split window on the down: press Ctrl + w and press j.Move to the split window on the left: press Ctrl + w and press h.:on - close all other windows but leave all buffers openĬonsider the following scenario, I have the Vim workspace divided into four quadrants.īelow are the four operations you can perform and the key combinations.:bd - unload the current buffer and then close the current window.:q - close the current window and the buffer as well.

There are several ways you can close/quit an active split window. It is " Ctrl + w" and then press the letter " s".

If you are wondering if any key combination exists for creating a horizontal split window, yes. If you specify a file path, it will open the file in the newly split window, otherwise the newly split window will open the same file.Ī shorter command to perform a horizontal split is to use the sp command. To make a horizontal split, enter Normal mode, and run the following command: :split Vim allows you to split the window horizontally as well. If you specify a file path, it will open the file in the newly split window, otherwise, the newly split window will open the same file.Ī shorter command to vsplit is vs (you can specify a file path with vs as well).Īs an alternative way to create a vertical split, you can press the Ctrl + w key combination, and lastly, press the letter " v" (v for vertical split).

To make a vertical split, enter Normal mode, and run the following command: :vsplit Split window verticallyĪssume that you have opened a file in Vim, and you want to split the screen vertically. You can know which window is active based on which window has your cursor. There are two ways you can split a Vim workspace - horizontally and/or vertically. Let's go over how to create a split window in Vim. Now you want to split the workspace into multiple windows for better productivity. Let me show you how to split Vim and all the necessary keyboard shortcuts to navigate between the split windows. Yes, Vim allows you to have multiple horizontal or vertical splits in your active workspace. New things like splitting the screen while using Vim in a terminal. As you get comfortable with the basics of Vim and start exploring it even more deeply, you discover new things.
