How do I paste the name of the alternate (previously edited) file into the buffer?
"#p
The # register holds the name of the alternate file — the file you were editing just before the current one.
370 results for "insert mode"
"#p
The # register holds the name of the alternate file — the file you were editing just before the current one.
"=2+3<CR>p
The expression register = evaluates a Vimscript expression and stores the result.
:help topic
Vim has an extensive built-in help system.
:set completeopt=menu,menuone,noselect
The completeopt option controls the behavior of the completion popup menu.
:nnoremap key command
The :nnoremap command creates a non-recursive normal mode mapping.
:set concealcursor=nvi
When 'conceallevel' is 2 or higher, Vim hides syntax markers—turning raw Markdown like bold into visual bold or collapsing LaTeX commands.
cit
The cit command deletes everything between the nearest pair of HTML/XML tags and drops you into insert mode, ready to type the replacement.
<C-r>#
The # register holds the alternate (previously edited) filename.
n.
The n.
cgn...{text}<Esc>.
The cgn + .
:set virtualedit=block
By default, Vim's visual block mode () is limited by line length — if some lines are shorter than others, the block selection gets ragged.
:set virtualedit=onemore
By default, Vim's cursor cannot go past the last character of a line in normal mode — pressing $ lands on the final character, not after it.
g; / g,
The g; and g, commands let you navigate Vim's changelist — a per-buffer history of every position where you made a change.
navigation #navigation #changelist #editing #normal-mode #marks
qaI<C-r>a<Esc>jq
Record a macro that inserts the contents of register a at the start of each line using a in insert mode, then moves down.
:echo @/
The / register holds the most recent search pattern.
:let i=1 then use <C-r>=i<CR> in macro
By combining a Vimscript variable with the expression register inside a macro, you can create a counter that increments on each replay.
"=strftime('%F')<CR>p
The expression register lets you compute text on demand and insert it without leaving Normal mode workflows.
registers #registers #expression-register #normal-mode #automation
:<C-u>MyCommand<CR>
When writing nnoremap or vnoremap mappings that call Ex commands, Vim may silently prepend a count or a visual range (') to your command before it runs.
`.
The ` .
@=
The @= command lets you type a Vimscript expression and execute the result as if it were a macro.