How do I insert special Unicode characters using digraphs in Vim?
<C-k>DG
Vim's digraph system lets you insert special characters by pressing followed by a two-character mnemonic code.
1029 results for "i" a""
<C-k>DG
Vim's digraph system lets you insert special characters by pressing followed by a two-character mnemonic code.
:%s/\s\+$//
The :%s/\s\+$// command removes trailing whitespace (spaces and tabs) from every line in the file.
gaip=
vim-easy-align is a plugin by Junegunn Choi that makes aligning text around delimiters effortless.
:lvimgrep /pattern/ %
While :vimgrep populates the global quickfix list, :lvimgrep uses the window-local location list instead.
:let view=winsaveview() | {cmd} | call winrestview(view)
When writing Vimscript functions or mappings, commands like :substitute, gg, or :%normal will move the cursor and change the scroll position.
v, V, or Ctrl-V while in visual mode
How it works Vim has three visual modes, and you can switch between them without losing your current selection: v - Characterwise visual mode (select individual
:Make / :Dispatch
The vim-dispatch plugin by Tim Pope provides asynchronous build and command execution so you can run compilers, test suites, and other long-running commands wit
:doautocmd User MyEvent
Vim's User event type lets you define custom events that fire on demand.
g*
The g command searches forward for the text under the cursor without adding word boundary anchors.
search #search #navigation #normal-mode #motions #productivity
:set undofile
By default, Vim's undo history is lost when you close a file.
:DB
The vim-dadbod plugin by Tim Pope turns Vim into a powerful database client.
cgn
The cgn command combines the change operator with the gn motion to change the next occurrence of your last search pattern.
:keeppattern s/old/new/g
When you run a :s or :g command, Vim updates the search register (@/) with the pattern you used.
:10,20t30
The :t command (short for :copy) duplicates lines from one location to another without touching any registers.
command-line #editing #ex-commands #lines #productivity #ranges
:m +1
The :move command (abbreviated :m) relocates lines to a new position in the buffer without touching any registers.
<C-w>+ / <C-w>- / <C-w>> / <C-w><
Vim provides keyboard shortcuts to resize split windows without reaching for the mouse.
:call feedkeys("iHello\<Esc>", 'n')
The feedkeys() function injects keystrokes into Vim's input buffer as if the user typed them.
]] / [[
The ]] and [[ commands let you jump forward and backward between section boundaries, which in most programming languages correspond to function or method defini
navigation #navigation #motions #normal-mode #code #functions
:CocInstall coc-tsserver
coc.
X
The X command deletes the character to the left of the cursor (before it).