How do I search and replace text only on the current line?
:s/old/new/g
The :s/old/new/g command replaces all occurrences of old with new on the current line only.
2125 results for "i" a""
:s/old/new/g
The :s/old/new/g command replaces all occurrences of old with new on the current line only.
:lua vim.lsp.inlay_hint.enable()
Neovim 0.
`0
Vim automatically saves your cursor position when you exit, storing it as the 0 mark in the viminfo file (or shada file in Neovim).
<C-r>
The (Ctrl+r) command redoes the last change that was undone with u.
/\%5l\%10cpattern
Vim provides position-matching atoms that constrain where a pattern can match based on line numbers, column positions, or virtual columns.
:colder / :cnewer
Vim remembers up to 10 previous quickfix lists.
<C-v>jjc replacement<Esc>
Visual block mode's change command lets you replace a rectangular column of text across multiple lines in a single operation.
visual-mode #editing #visual-mode #block-mode #normal-mode #productivity
:set complete-=i
Vim's complete option controls which sources are scanned when you press or to complete a word.
\v
Vim's default regex mode ("magic") requires backslashes before many special characters: \(, \ , \+, \{.
:earlier {time}
Vim's :earlier and :later commands let you travel through undo history using real-world time intervals instead of individual change counts.
:set synmaxcol=200
The synmaxcol option tells Vim the maximum column up to which it will apply syntax highlighting on each line.
:cabbrev tn tabnew
Command-line abbreviations with cabbrev let you create short aliases for frequently used Ex commands.
command-line #command-line #abbreviation #shortcuts #productivity
:LspInfo
The :LspInfo command, provided by the nvim-lspconfig plugin, opens a diagnostic floating window showing every active LSP client and its configuration for the cu
<C-k>DG
Vim's digraph system lets you insert special characters by pressing followed by a two-character mnemonic code.
mf mt mc
Netrw, Vim's built-in file browser, supports a full marking system that lets you select multiple files and then perform bulk copy, move, or delete operations on
expand('%:p:h:t')
Vim's filename modifiers can be chained to transform paths step by step.
:lvimgrep /pattern/ %
While :vimgrep populates the global quickfix list, :lvimgrep uses the window-local location list instead.
vim --startuptime /tmp/vim-startup.log +qall && sort -k2 -rn /tmp/vim-startup.log | head -20
When Vim starts slowly, the --startuptime flag writes a timestamped log of every script and plugin loaded during initialization.
:doautocmd User MyEvent
Vim's User event type lets you define custom events that fire on demand.
:bufdo
When you need to apply the same change to every file you have open in Vim, switching to each buffer manually is tedious and error-prone.