How do I resize a window horizontally?
<C-w>> and <C-w><
The > and > increases width by 1 column > increases width by 10 columns maximizes the window width Example With a vertical split, 20> gives the current window 2
<C-w>> and <C-w><
The > and > increases width by 1 column > increases width by 10 columns maximizes the window width Example With a vertical split, 20> gives the current window 2
:ball
The :ball command opens a window for every buffer in the buffer list.
:diffthis in both windows
The :diffthis command enables diff mode for the current buffer.
:bp | bd #
The :bp bd # command switches to the previous buffer and then deletes the alternate buffer.
:set scrollbind
The scrollbind option locks the scrolling of two or more windows together so they scroll in unison.
<C-w>]
The ] command opens the definition of the tag under the cursor in a new horizontal split.
let g:netrw_liststyle=3 and let g:netrw_banner=0
How it works Vim ships with a built-in file explorer called netrw that you can access with :Explore (or :Ex).
:set splitbelow splitright
How it works By default, Vim opens horizontal splits (:split or :sp) above the current window and vertical splits (:vsplit or :vsp) to the left.
:set winfixwidth winfixheight
How it works When you open new split windows in Vim, the existing windows automatically resize to make room.
do (diffget) / dp (diffput)
How it works When you open two files in diff mode (using vim -d file1 file2 or :windo diffthis), Vim highlights the differences between them.
<C-w>}
How it works The } command opens a preview window showing the tag definition of the word under your cursor.
<C-w>f
How it works You may already know that gf opens the file path under the cursor in the current window.
<C-w>x
How it works The x command exchanges the current window with the next one.
<C-w>h / <C-w>j / <C-w>k / <C-w>l
How it works Vim lets you navigate between split windows using followed by a direction key.
<C-w>+
When working with multiple split windows, you often need to resize them to see more content in one pane.
:windo / :bufdo / :tabdo {command}
Vim's do commands iterate over collections and execute a command in each context.
buffers-windows #buffers #windows #tabs #batch-editing #ex-commands
:resize N / :vertical resize N
The :resize and :vertical resize commands set a window to an exact number of lines or columns.
:tabnew | lcd /path/to/project
Vim's :lcd (local change directory) sets the working directory per window.
buffers-windows #buffers #windows #tabs #workflow #project-management
<C-w>| and <C-w>_ / <C-w>=
Vim lets you temporarily maximize a split window to full width or full height, and then restore all windows to equal sizes with =.
buffers-windows #windows #splits #navigation #productivity #layout
:tabnew / gt / gT
Vim's tab pages let you organize your workspace into separate views, each containing its own window layout.
buffers-windows #buffers #windows #tabs #navigation #productivity