How do you cycle between next and previous buffers?
:bn and :bp
Use :bn (bnext) to go to the next buffer and :bp (bprevious) to go to the previous one.
: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.
:bwipeout
The :bwipeout command (:bw) completely removes a buffer from Vim's memory, including its marks, options, and variables.
<C-w>H
The H command moves the current window to the far left, making it a full-height vertical split.
:enew
The :enew command creates a new unnamed empty buffer in the current window.
<C-w>p
The p command jumps to the previously active window (the last window you were in).
:b {number}
The :b command followed by a buffer number switches directly to that buffer.
<C-w>r
The r command rotates windows in the current row or column.
gt and gT
The gt command moves to the next tab page and gT moves to the previous one.
:mksession and :source
The :mksession command saves the current Vim session (windows, buffers, tabs, cursor positions) to a file.
<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
:bufdo command
The :bufdo command executes an Ex command on every buffer in the buffer list.
: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.
:nnoremap <buffer> <leader>r :!python %<CR>
How it works By adding to a mapping command, the mapping only applies to the current buffer.