How do I use cgn to repeat a change on every search match?
/pattern<CR>cgnreplacement<Esc>.
The gn text object selects the next search match, and cgn changes it.
2277 results for "@a"
/pattern<CR>cgnreplacement<Esc>.
The gn text object selects the next search match, and cgn changes it.
:lua vim.api.nvim_open_win(0, true, {relative='editor', width=80, height=20, row=5, col=10})
Neovim's floating windows hover above the main layout, creating popup-like UI elements.
g??
Vim has a built-in ROT13 operator g? that encodes text by rotating each letter 13 positions in the alphabet.
:let @/ = '\V' . escape(expand('<cword>'), '\')
This pattern lets you prepare a precise search target without jumping the cursor or triggering an immediate search motion.
:windo setlocal colorcolumn=+1
When a setting is window-local, changing it once does not affect your other splits.
:execute 'vimgrep /' . @/ . '/gj **/*'
If you already refined a search interactively with / or ?, retyping that pattern for project-wide grep is repetitive and error-prone.
:v/pattern/d
The :v command (short for :vglobal) is the inverse of :g — it executes a command on every line that does not match the given pattern.
command-line #editing #ex-commands #search #filtering #productivity
:silent!
The :silent! modifier runs an Ex command without displaying any output or error messages.
:set inccommand=nosplit
When you are crafting a risky :substitute command, the expensive part is usually confidence, not typing.
:set virtualedit=block
By default, Vim's visual block mode () is limited by line length — if some lines are shorter than others, the block selection gets ragged.
vim.api.nvim_buf_call()
vim.
/pattern\{3}
Vim supports counted quantifiers that let you specify exactly how many times a pattern should repeat.
ZQ
ZQ is the discard-and-quit counterpart to ZZ.
I
The I (uppercase) command moves the cursor to the first non-blank character of the current line and enters insert mode.
!{motion}{program}
The ! operator in normal mode lets you pipe a range of text through any external program and replace it with the output.
:%!
The ! operator pipes text through a shell command, replacing the selected lines with the command's output.
v:event
The v:event dictionary is populated inside certain autocommand callbacks with data specific to that event.
vim.lsp.enable()
Neovim 0.
/foo\_.*bar
Vim's default .
:noautocmd w
The :noautocmd modifier runs any Ex command while suppressing all autocmd events for its duration.