How do I change existing surrounding quotes to parentheses with vim-surround?
cs"(
The cs operator in vim-surround (change surrounding) swaps one pair of delimiters for another without touching the content inside.
cs"(
The cs operator in vim-surround (change surrounding) swaps one pair of delimiters for another without touching the content inside.
set complete+=kspell
Adding kspell to the complete option makes and draw from the active spell word list — every word Vim considers correctly spelled.
<C-g>U{motion}
By default, moving the cursor with arrow keys while in insert mode creates an undo break — meaning a subsequent u will undo only back to when you last moved,
zug
When spell checking is active, pressing zg over a word adds it to your personal word list so Vim stops flagging it.
:e!
:e! forces Vim to reload the current file from disk, discarding every unsaved change in the buffer.
buffers-windows #buffers-windows #editing #undo-redo #ex-commands
:set nrformats
The nrformats option tells Vim how to interpret numbers when you press (increment) or (decrement).
autocmd BufNewFile *.py 0r ~/.vim/templates/python.py
When you create a new file in Vim (e.
vim.lsp.buf.format()
Neovim's built-in LSP client exposes vim.
gr{char}
The gr{char} command is Vim's virtual replace variant of r{char}.
:g/^/t.
The command :g/^/t.
<C-x><C-d>
in insert mode triggers defined identifier completion — it searches for identifiers that match the partial word before the cursor by scanning #define statemen
set nrformats+=alpha
By default, Vim's and commands only increment and decrement numbers (decimal, hex, binary).
set nrformats-=octal
By default, Vim treats numbers prefixed with a leading zero (like 007) as octal when you use or to increment or decrement them.
:g/./norm @q
Combining the :global command with :normal lets you run a macro on every non-blank line in one shot.
:'<,'>sort!
The sort! command sorts the selected lines in reverse (descending) order.
:silent! %normal @q
Combining :silent!, the % range, and :normal @q gives you a powerful pattern for applying a macro across an entire file while gracefully skipping lines that don
v (netrw)
When browsing files in Vim's built-in file manager (Netrw), pressing v on any file opens it in a vertical split to the right.
<C-r><C-r>
In command-line mode, {reg} inserts a register's contents — but it processes certain sequences, potentially misinterpreting backslashes, pipe characters, or e
<C-v> (command-line mode)
In command-line mode (after : or /), pressing followed by any key inserts that key literally — bypassing all key notation, mappings, and special interpretatio
:0put
The :put Ex command inserts register contents as a new line below the specified line number.