How do I resize split windows using the keyboard in Vim?
<C-w>+ / <C-w>- / <C-w>> / <C-w><
Vim provides keyboard shortcuts to resize split windows without reaching for the mouse.
<C-w>+ / <C-w>- / <C-w>> / <C-w><
Vim provides keyboard shortcuts to resize split windows without reaching for the mouse.
:Explore
Netrw is Vim's built-in file explorer plugin that comes with every Vim installation.
:set autoread
The autoread option tells Vim to automatically re-read a file when it detects the file has been changed outside of Vim.
:tab help
By default, :help opens in a horizontal split, which can feel cramped.
:Vexplore
Vim ships with netrw, a built-in file explorer that requires no plugins.
nnoremap <leader>b :b#<CR>
Map b to :b# which switches to the alternate buffer.
:bunload
Use :bunload or :bun to unload the current buffer from memory while keeping it in the buffer list.
:sb 3
Use :sb (sbuffer) followed by the buffer number to open that buffer in a new horizontal split.
:vert sb 3
Use :vert sb 3 to open buffer 3 in a vertical split.
:bn and :bp
Use :bn (bnext) to go to the next buffer and :bp (bprevious) to go to the previous one.
:bufdo %s/old/new/g
Use :bufdo to execute a command in every buffer.
:b name
Use :b with a partial filename.
:b3
Use :b followed by the buffer number.
:call DeleteHiddenBuffers()
Define a function or use a plugin.
:bd 3
Use :bd (bdelete) followed by the buffer number.
"# register
The # register contains the name of the alternate file — the previously edited file in the current window.
:bwipeout
The :bwipeout command (:bw) completely removes a buffer from Vim's memory, including its marks, options, and variables.
:enew
The :enew command creates a new unnamed empty buffer in the current window.
:b {number}
The :b command followed by a buffer number switches directly to that buffer.
:mksession and :source
The :mksession command saves the current Vim session (windows, buffers, tabs, cursor positions) to a file.