Home Explore Blog CI



neovim

14th chunk of `runtime/doc/change.txt`
05be53c00832818886cd65c2815f4bfa378767bb577d77e50000000100000fa4
 contents of the numbered and named
			registers that are mentioned in {arg}.  For example: >
				:reg 1a
<			to display registers '1' and 'a'.  Spaces are allowed
			in {arg}.

							*:di* *:dis* *:display*
:di[splay] [arg]	Same as :registers.

							*y* *yank*
["x]y{motion}		Yank {motion} text [into register x].  When no
			characters are to be yanked (e.g., "y0" in column 1),
			this is an error when 'cpoptions' includes the 'E'
			flag.

							*yy*
["x]yy			Yank [count] lines [into register x] |linewise|.

							*Y*
["x]Y			yank [count] lines [into register x] (synonym for
			yy, |linewise|).
							*Y-default*
			Mapped to "y$" by default. |default-mappings|

							*zy*
["x]zy{motion}		Yank {motion} text [into register x].  Only differs
			from `y` when selecting a block of text, see |v_zy|.

							*v_y*
{Visual}["x]y		Yank the highlighted text [into register x] (for
			{Visual} see |Visual-mode|).

							*v_Y*
{Visual}["x]Y		Yank the highlighted lines [into register x] (for
			{Visual} see |Visual-mode|).

							*v_zy*
{Visual}["x]zy		Yank the highlighted text [into register x].  Trailing
			whitespace at the end of each line of a selected block
			won't be yanked.  Especially useful in combination
			with `zp`.  (for {Visual} see |Visual-mode|)

							*:y* *:yank* *E850*
:[range]y[ank] [x]	Yank [range] lines [into register x].

:[range]y[ank] [x] {count}
			Yank {count} lines, starting with last line number
			in [range] (default: current line |cmdline-ranges|),
			[into register x].

						*p* *put* *E353* *E1240*
["x]p			Put the text [from register x] after the cursor
			[count] times.

							*P*
["x]P			Put the text [from register x] before the cursor
			[count] times.

							*<MiddleMouse>*
["x]<MiddleMouse>	Put the text from a register before the cursor [count]
			times.  Uses the "* register, unless another is
			specified.
			Leaves the cursor at the end of the new text.
			Using the mouse only works when 'mouse' contains 'n'
			or 'a'.
			If you have a scrollwheel and often accidentally paste
			text, you can use these mappings to disable the
			pasting with the middle mouse button: >
				:map <MiddleMouse> <Nop>
				:imap <MiddleMouse> <Nop>
<			You might want to disable the multi-click versions
			too, see |double-click|.

							*gp*
["x]gp			Just like "p", but leave the cursor just after the new
			text.

							*gP*
["x]gP			Just like "P", but leave the cursor just after the new
			text.

							*:pu* *:put*
:[line]pu[t] [x]	Put the text [from register x] after [line] (default
			current line).  This always works |linewise|, thus
			this command can be used to put a yanked block as new
			lines.
			If no register is specified, it depends on the 'cb'
			option: If 'cb' contains "unnamedplus", paste from the
			+ register |quoteplus|.  Otherwise, if 'cb' contains
			"unnamed", paste from the * register |quotestar|.
			Otherwise, paste from the unnamed register
			|quote_quote|.
			The register can also be '=' followed by an optional
			expression.  The expression continues until the end of
			the command.  You need to escape the '|' and '"'
			characters to prevent them from terminating the
			command.  Example: >
				:put ='path' .. \",/test\"
<			If there is no expression after '=', Vim uses the
			previous expression.  You can see it with ":dis =".

:[line]pu[t]! [x]	Put the text [from register x] before [line] (default
			current line).

							*:ip* *:iput*
:[line]ip[ut] [x]	like |:put|, but adjust indent to the current line

:[line]ip[ut]! [x]	like |:put|!, but adjust indent to the current line

["x]]p		    or					*]p* *]<MiddleMouse>*
["x]]<MiddleMouse>	Like "p", but adjust the indent to the current line.
			Using the mouse only works when 'mouse' contains 'n'
			or 'a'.

["x][P		    or					*[P*
["x]]P		    or					*]P*
["x][p		    or					*[p* *[<MiddleMouse>*
["x][<MiddleMouse>	Like "P", but adjust the indent to the current line.
			Using the mouse only works when 'mouse' contains 'n'
			or 'a'.

Title: Vim: Yanking, Putting, and Registers in Detail
Summary
This section elaborates on the `y` (yank) command and its variations, including `yy` (yank line), `Y` (synonym for `yy`), `zy` (yank block, excluding trailing whitespace), and their visual mode counterparts (`v_y`, `v_Y`, `v_zy`). It also covers the `:yank` command with range and count options. Furthermore, it provides an in-depth explanation of the `p` (put) and `P` (put before cursor) commands for pasting text from registers, including the use of the middle mouse button and the `gp` and `gP` variants. It also includes indent-aware putting and expressions. It also covers the `:put` command for pasting after a specific line, with options for indent adjustment and register selection, including the use of expressions.