How do I auto-format code on save using conform.nvim?
:lua require('conform').format()
conform.
366 results for ":w"
:lua require('conform').format()
conform.
<C-o>{cmd}
Pressing in insert mode lets you execute one normal mode command and then automatically returns you to insert mode.
:call feedkeys("iHello\<Esc>", 'n')
The feedkeys() function injects keystrokes into Vim's input buffer as if the user typed them.
:WhichKey
which-key.
\u and \l in :s replacement
Vim's substitute command supports special case modifiers in the replacement string that let you change the case of captured text on the fly.
%:r
The %:r expression expands to the current filename with its extension removed (the "root" of the filename).
qagUiwWq2@a
Macros are most powerful when they encode both the edit and the movement to the next target.
:g/pattern/join
The :g/pattern/join command combines the :global command with :join to merge every line matching a pattern with the line immediately following it.
command-line #ex-commands #editing #command-line #search #normal-mode
:set eadirection=hor
If you use many splits, automatic equalization can feel disruptive when Vim resizes both height and width after layout changes.
qqq
Pressing qqq in normal mode is the quickest way to empty a macro register.
/\zs and \ze
The \zs and \ze atoms let you define where the actual match starts and ends within a larger pattern.
:s/\d\+/\=submatch(0)+1/g
The \= prefix in a :substitute replacement field tells Vim to evaluate the following as a Vimscript expression rather than treating it as a literal string.
:vertical {cmd}
The :vertical command modifier forces any window-opening Ex command to create a vertical split instead of the default horizontal split.
buffers-windows #windows #buffers #command-line #splits #ex-commands
:wall
When working across multiple files, you often have unsaved changes in several buffers.
gP
The gP command works like P (paste before the cursor) but leaves your cursor after the pasted text rather than at its beginning.
:%s/pattern/\=expression/g
Vim's substitute command supports expression replacements using \= in the replacement string.
/\(pattern\)\@<=target or /target\(pattern\)\@=
Vim supports zero-width assertions (lookahead and lookbehind) in its regex engine.
:<C-r>"
When typing an Ex command or search pattern, you often need to insert text you've already yanked or deleted.
:%s/,/\r/g
In Vim's substitute command, \r in the replacement string inserts a newline.
gr{motion}
Neovim 0.