Home Explore Blog CI



neovim

1st chunk of `runtime/doc/insert.txt`
0821100bea1737b6400796fcceeb966bfc7778322e47bcf80000000100000fa2
*insert.txt*    Nvim


		  VIM REFERENCE MANUAL    by Bram Moolenaar


						*Insert* *Insert-mode*
Inserting and replacing text				*mode-ins-repl*

Most of this file is about Insert and Replace mode.  At the end are a few
commands for inserting text in other ways.

An overview of the most often used commands can be found in chapter 24 of the
user manual |usr_24.txt|.

Also see 'virtualedit', for moving the cursor to positions where there is no
character.  Useful for editing a table.

                                      Type |gO| to see the table of contents.

==============================================================================
1. Special keys						*ins-special-keys*

In Insert and Replace mode, the following characters have a special meaning;
other characters are inserted directly.  To insert one of these special
characters into the buffer, precede it with CTRL-V.  To insert a <Nul>
character use "CTRL-V CTRL-@" or "CTRL-V 000".  On some systems, you have to
use "CTRL-V 003" to insert a CTRL-C.  Note: When CTRL-V is mapped you can
often use CTRL-Q instead |i_CTRL-Q|.

If you are working in a special language mode when inserting text, see the
'langmap' option, |'langmap'|, on how to avoid switching this mode on and off
all the time.

char		action	~
-----------------------------------------------------------------------
						*i_CTRL-[* *i_<Esc>*
<Esc> or CTRL-[	End insert or Replace mode, go back to Normal mode.  Finish
		abbreviation.
		Note: If your <Esc> key is hard to hit, try CTRL-[ instead.
						*i_META* *i_ALT*
		ALT (|META|) may act like <Esc> if the chord is not mapped.
		For example <A-x> acts like <Esc>x if <A-x> does not have an
		insert-mode mapping.
						*i_CTRL-C*
CTRL-C		Quit insert mode, go back to Normal mode.  Do not check for
		abbreviations.  Does not trigger the |InsertLeave| autocommand
		event.

						*i_CTRL-@*
CTRL-@		Insert previously inserted text and stop insert.

						*i_CTRL-A*
CTRL-A		Insert previously inserted text.

						*i_CTRL-H* *i_<BS>* *i_BS*
<BS> or CTRL-H	Delete the character before the cursor (see |i_backspacing|
		about joining lines).
						*i_<Del>* *i_DEL*
<Del>		Delete the character under the cursor.  If the cursor is at
		the end of the line, and the 'backspace' option includes
		"eol" (the default), delete the <EOL>; the next line is
		appended after the current one.
						*i_CTRL-W*
CTRL-W		Delete the word before the cursor (see |i_backspacing| about
		joining lines).  See the section "word motions",
		|word-motions|, for the definition of a word.
						*i_CTRL-W-default*
		By default, sets a new undo point before deleting.
		|default-mappings|
						*i_CTRL-U*
CTRL-U		Delete all entered characters before the cursor in the current
		line.  If there are no newly entered characters and
		'backspace' is not empty, delete all characters before the
		cursor in the current line.
		If C-indenting is enabled the indent will be adjusted if the
		line becomes blank.
		See |i_backspacing| about joining lines.
						*i_CTRL-U-default*
		By default, sets a new undo point before deleting.
		|default-mappings|
						*i_CTRL-I* *i_<Tab>* *i_Tab*
<Tab> or CTRL-I Insert a tab.  If the 'expandtab' option is on, the
		equivalent number of spaces is inserted (use CTRL-V <Tab> to
		avoid the expansion; use CTRL-Q <Tab> if CTRL-V is mapped
		|i_CTRL-Q|).  See also the 'smarttab' option and
		|ins-expandtab|.
						*i_CTRL-J* *i_<NL>*
<NL> or CTRL-J	Begin new line.
						*i_CTRL-M* *i_<CR>*
<CR> or CTRL-M	Begin new line.
						*i_CTRL-K*
CTRL-K {char1} [char2]
		Enter digraph (see |digraphs|).  When {char1} is a special
		key, the code for that key is inserted in <> form.  For
		example, the string "<S-Space>" can be entered by typing
		<C-K><S-Space> (two keys).  Neither char is considered for
		mapping.

CTRL-N		Find next keyword (see |i_CTRL-N|).
CTRL-P		Find previous keyword (see |i_CTRL-P|).

CTRL-R {register}				*i_CTRL-R*
		Insert the contents of a register.  Between typing CTRL-R

Title: Vim - Insert Mode Special Keys
Summary
This section of the Vim reference manual describes Insert mode and Replace mode, detailing special keys and their functions within these modes. It covers actions such as exiting insert mode, deleting characters, inserting tabs or newlines, using digraphs, and inserting contents from registers. It also mentions the impact of options like 'langmap', 'expandtab', and 'smarttab' on insert mode behavior.