How do I read the contents of a Vim register into a variable or expression using Vimscript?
getreg()
The getreg({name}) function returns the content of any register as a string.
870 results for "it at"
getreg()
The getreg({name}) function returns the content of any register as a string.
vim.ui.select()
Neovim exposes vim.
<C-y> and <C-e>
In Insert mode, copies the character at the same column position from the line above the cursor, and copies the character from the line below.
:mkview 2 and :loadview 2
Vim supports up to 9 numbered view slots per file.
buffers-windows #folding #buffers-windows #navigation #config
:ptjump /{pattern}
When a symbol name is ambiguous, jumping directly with :tag can bounce you around the codebase and disrupt your working context.
navigation #navigation #tags #windows #code-navigation #command-line
:tab split
:tab split opens the current buffer in a brand new tab page, giving you a second independent view of the same file.
:Inspect
When customizing a colorscheme or debugging unexpected syntax colors, it's difficult to know which highlight group to override.
:set nostartofline
By default, many Vim movement commands — gg, G, Ctrl-d, Ctrl-u, Ctrl-f, Ctrl-b, and others — snap the cursor to the first non-blank character of the destina
<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,
mA and 'A
Vim has two tiers of marks.
do
The do command (diff obtain) is shorthand for :diffget.
:set keywordprg
The K key in normal mode looks up the word under the cursor using the program defined by keywordprg.
q?
Vim provides three command-line history windows accessible from normal mode: q: for Ex commands, q/ for forward searches, and q? for backward searches.
42G
The 42G command jumps the cursor directly to line 42 in the current file.
:packadd
Since Vim 8 and Neovim, Vim has a built-in package system that can load plugins directly from the filesystem — no external plugin manager required.
y/{pattern}<CR>
Any operator in Vim can take a search motion as its argument.
nnoremap <expr> j v:count == 0 ? 'gj' : 'j'
By default, j and k move by physical lines (newline-delimited), which jumps over the entire visual span of a long wrapped line in a single keystroke.
:nnoremap <buffer> <leader>r :!python %<CR>
How it works By adding to a mapping command, the mapping only applies to the current buffer.
vim.keymap.del()
vim.
:earlier {N}m and :later {N}m
Vim's :earlier and :later commands let you travel through your edit history by wall-clock time rather than by individual undo steps.