How do I open a file explorer in a vertical split without any plugins?
:Vexplore
Vim ships with netrw, a built-in file explorer that requires no plugins.
: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.
: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.