Home Explore Blog CI



neovim

3rd chunk of `runtime/doc/cmdline.txt`
3fe0afacaa5b8eda813be2102b19f9f83cb9e0fe21a5f81d0000000100000fa1
 which might not be what you intended.
		Special registers:
			'"'	the unnamed register, containing the text of
				the last delete or yank
			'%'	the current file name
			'#'	the alternate file name
			"*"	the clipboard contents (X11: primary selection)
			'+'	the clipboard contents
			'/'	the last search pattern
			':'	the last command-line
			'-'	the last small (less than a line) delete
			'.'	the last inserted text
							*c_CTRL-R_=*
			'='	the expression register: you are prompted to
				enter an expression (see |expression|)
				(doesn't work at the expression prompt; some
				things such as changing the buffer or current
				window are not allowed to avoid side effects)
				When the result is a |List| the items are used
				as lines.  They can have line breaks inside
				too.
				When the result is a Float it's automatically
				converted to a String.
				Note that when you only want to move the
				cursor and not insert anything, you must make
				sure the expression evaluates to an empty
				string.  E.g.: >
					<C-R><C-R>=setcmdpos(2)[-1]<CR>
<		See |registers| about registers.
		Implementation detail: When using the |expression| register
		and invoking setcmdpos(), this sets the position before
		inserting the resulting string.  Use CTRL-R CTRL-R to set the
		position afterwards.

CTRL-R CTRL-F				*c_CTRL-R_CTRL-F* *c_<C-R>_<C-F>*
CTRL-R CTRL-P				*c_CTRL-R_CTRL-P* *c_<C-R>_<C-P>*
CTRL-R CTRL-W				*c_CTRL-R_CTRL-W* *c_<C-R>_<C-W>*
CTRL-R CTRL-A				*c_CTRL-R_CTRL-A* *c_<C-R>_<C-A>*
CTRL-R CTRL-L				*c_CTRL-R_CTRL-L* *c_<C-R>_<C-L>*
		Insert the object under the cursor:
			CTRL-F	the Filename under the cursor
			CTRL-P	the Filename under the cursor, expanded with
				'path' as in |gf|
			CTRL-W	the Word under the cursor
			CTRL-A	the WORD under the cursor; see |WORD|
			CTRL-L	the line under the cursor

		When 'incsearch' is set the cursor position at the end of the
		currently displayed match is used.  With CTRL-W the part of
		the word that was already typed is not inserted again.

					*c_CTRL-R_CTRL-R* *c_<C-R>_<C-R>*
					*c_CTRL-R_CTRL-O* *c_<C-R>_<C-O>*
CTRL-R CTRL-R `{register CTRL-F CTRL-P CTRL-W CTRL-A CTRL-L}`
CTRL-R CTRL-O `{register CTRL-F CTRL-P CTRL-W CTRL-A CTRL-L}`
		Insert register or object under the cursor.  Works like
		|c_CTRL-R| but inserts the text literally.  For example, if
		register a contains "xy^Hz" (where ^H is a backspace),
		"CTRL-R a" will insert "xz" while "CTRL-R CTRL-R a" will
		insert "xy^Hz".

CTRL-\ e {expr}						*c_CTRL-\_e*
		Evaluate {expr} and replace the whole command line with the
		result.  You will be prompted for the expression, type <Enter>
		to finish it.  It's most useful in mappings though.  See
		|expression|.
		See |c_CTRL-R_=| for inserting the result of an expression.
		Useful functions are |getcmdtype()|, |getcmdline()| and
		|getcmdpos()|.
		The cursor position is unchanged, except when the cursor was
		at the end of the line, then it stays at the end.
		|setcmdpos()| can be used to set the cursor position.
		The |sandbox| is used for evaluating the expression to avoid
		nasty side effects.
		Example: >
			:cmap <F7> <C-\>eAppendSome()<CR>
			:func AppendSome()
			   :let cmd = getcmdline() .. " Some()"
			   :" place the cursor on the )
			   :call setcmdpos(strlen(cmd))
			   :return cmd
			:endfunc
<		This doesn't work recursively, thus not when already editing
		an expression.  But it is possible to use in a mapping.

							*c_CTRL-Y*
CTRL-Y		When there is a modeless selection, copy the selection into
		the clipboard.
		If there is no selection CTRL-Y is inserted as a character.
		See 'wildmenu' for behavior during wildmenu completion mode.

							*c_CTRL-Z*
CTRL-Z		Trigger 'wildmode'. Same as 'wildcharm', but always available.

CTRL-M or CTRL-J		*c_CTRL-M* *c_CTRL-J* *c_<NL>* *c_<CR>* *c_CR*
<CR> or <NL>	start entered command

CTRL-[						*c_CTRL-[* *c_<Esc>* *c_Esc*
<Esc>		When typed and 'x' not present in 'cpoptions', quit
		Command-line mode without

Title: Vim Command-Line Editing: Special Registers and Advanced Features
Summary
This section expands on the use of special registers in Vim's command-line mode, particularly when using CTRL-R to insert their contents. It details specific registers like '"' (unnamed), '%' (current file), '#' (alternate file), '*' and '+' (clipboard), '/' (last search pattern), ':' (last command-line), '-' (small delete), and '.' (last inserted text). It also elaborates on the expression register ('=') for evaluating expressions and inserting the result. Additionally, the section covers advanced features like CTRL-R with CTRL-F/P/W/A/L for inserting objects under the cursor, the literal insertion variants (CTRL-R CTRL-R and CTRL-R CTRL-O), CTRL-\ e for replacing the command line with an expression's result, and CTRL-Y for copying modeless selections. It concludes with CTRL-Z for triggering 'wildmode' and CTRL-M, CTRL-J, <CR>, and <NL> for starting the entered command, as well as <Esc> for quitting command-line mode.