How do I insert the result of a Vimscript expression as a new line?
:put ={expr}
The :put ={expr} command evaluates a Vimscript expression and inserts the result as a new line below the cursor.
953 results for ":normal"
:put ={expr}
The :put ={expr} command evaluates a Vimscript expression and inserts the result as a new line below the cursor.
gg=G
The gg=G command re-indents every line in the current file according to Vim's indentation rules.
:reg {names}
The :registers command dumps every register at once, which is noisy when you only care about a handful.
gj
The gj command moves the cursor down by one display line rather than one physical line.
[[ and ]]
[[ and ]] navigate between section boundaries — typically the start of the previous or next top-level block.
\c
Vim lets you embed \c or \C directly inside a search pattern to control case sensitivity for that search only, regardless of your 'ignorecase' and 'smartcase' s
:set nrformats=
The nrformats option controls which number formats (increment) and (decrement) recognize.
g<C-x>
Most people know decrements one number under the cursor, but g in Visual mode performs a sequential decrement across the selection.
: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
do
The do command (diff obtain) is shorthand for :diffget.
.
The .
:nnoremap <buffer> <leader>r :!python %<CR>
How it works By adding to a mapping command, the mapping only applies to the current buffer.
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.
ci(
The ci( command deletes everything inside the nearest pair of parentheses and places you in insert mode, ready to type a replacement.
g~iw
The g~iw command toggles the case of every character in the word under the cursor — uppercase letters become lowercase and vice versa.
\u / \l / \U / \L (in :s replacement)
Vim's :substitute replacement string supports case-conversion modifiers that let you uppercase or lowercase matched text without writing a separate command.
:set foldtext={expr}
The foldtext option controls what Vim displays for a closed fold.
:set nrformats-=octal<CR>
By default, Vim may treat numbers with leading zeros as octal when you use and for increment/decrement.
vim.highlight.on_yank()
After yanking text in Vim it can be hard to tell exactly what was captured, especially with larger motions or text objects.
gg
The gg command moves the cursor to the first line of the file.