How do I switch to the next buffer in Vim?
:bnext
The :bnext (or :bn for short) command switches to the next buffer in Vim's buffer list.
2277 results for "@a"
:bnext
The :bnext (or :bn for short) command switches to the next buffer in Vim's buffer list.
:packadd {package}
Vim ships with several useful packages in its opt/ directory that are not loaded by default.
:set diffopt+=iwhite
When comparing files in Vim's diff mode, whitespace-only changes (extra spaces, changed indentation) can clutter the diff and hide meaningful edits.
>%
Vim's > operator (indent) works with any motion or text object — including %, which jumps to the bracket, parenthesis, or brace matching the one under the cur
editing #editing #indentation #text-objects #normal-mode #motions
vim.diagnostic.config({virtual_lines = true})
Neovim 0.
:set grepprg=rg\ --vimgrep\ --smart-case\ --hidden\ --glob\ !.git
Vim's :grep becomes much more useful when grepprg is tuned for ripgrep and quickfix-compatible output.
vi{
The vi{ command visually selects everything inside the nearest pair of curly braces {}, without selecting the braces themselves.
visual-mode #visual-mode #text-objects #editing #normal-mode
<C-x><C-o>
The keystroke triggers omni completion, Vim's built-in language-aware completion system.
[{ / ]}
When editing code inside a deeply nested block, [{ jumps backward to the unmatched { that encloses the current position, and ]} jumps forward to its matching }.
{ and }
The { and } commands move the cursor by paragraph — jumping to the previous or next blank line.
autocmd FileType python setlocal expandtab shiftwidth=4
Vim's autocmd FileType lets you apply settings automatically whenever a specific file type is detected.
:set complete-=i
Vim's complete option controls which sources are scanned when you press or to complete a word.
:vimgrep /pattern/j **/*
By default, :vimgrep jumps your cursor to the first match it finds, which can be disorienting when you just want to collect results and browse them on your own
H
The H command moves the cursor to the first line of the currently visible screen (the "High" position).
augroup name | autocmd! | autocmd ... | augroup END
Autocommand groups (augroup) with autocmd! prevent duplicate autocommands from accumulating every time you source your vimrc.
vim.ui.select() and vim.ui.input()
Neovim provides vim.
:bprev
The :bprev (or :bp for short) command switches to the previous buffer in Vim's buffer list.
:'<,'>sort
The :'sort command sorts the currently selected lines in visual mode alphabetically.
:cwindow
The :cwindow command intelligently manages the quickfix window — it opens the window only if there are entries in the quickfix list, and closes it if the list
cs{from}{to}
The cs command from the vim-surround plugin lets you swap one type of surrounding delimiter for another in a single motion.