Home Explore Blog CI



neovim

1st chunk of `runtime/doc/usr_24.txt`
47a278a74e8fcc95b8ab08658f0fe4acd4145a664a479fe50000000100000fc4
*usr_24.txt*	Nvim

		     VIM USER MANUAL - by Bram Moolenaar

			     Inserting quickly


When entering text, Vim offers various ways to reduce the number of keystrokes
and avoid typing mistakes.  Use Insert mode completion to repeat previously
typed words.  Abbreviate long words to short ones.  Type characters that
aren't on your keyboard.

|24.1|	Making corrections
|24.2|	Showing matches
|24.3|	Completion
|24.4|	Repeating an insert
|24.5|	Copying from another line
|24.6|	Inserting a register
|24.7|	Abbreviations
|24.8|	Entering special characters
|24.9|	Digraphs
|24.10|	Normal mode commands

     Next chapter: |usr_25.txt|  Editing formatted text
 Previous chapter: |usr_23.txt|  Editing other files
Table of contents: |usr_toc.txt|

==============================================================================
*24.1*	Making corrections

The <BS> key was already mentioned.  It deletes the character just before the
cursor.  The <Del> key does the same for the character under (after) the
cursor.
   When you typed a whole word wrong, use CTRL-W:

	The horse had fallen to the sky ~
				       CTRL-W
	The horse had fallen to the ~

If you really messed up a line and want to start over, use CTRL-U to delete
it.  This keeps the text after the cursor and the indent.  Only the text from
the first non-blank to the cursor is deleted.  With the cursor on the "f" of
"fallen" in the next line pressing CTRL-U does this:

	The horse had fallen to the ~
		      CTRL-U
	fallen to the ~

When you spot a mistake a few words back, you need to move the cursor there to
correct it.  For example, you typed this:

	The horse had follen to the ground ~

You need to change "follen" to "fallen".  With the cursor at the end, you
would type this to correct it: >

					<Esc>4blraA

<	get out of Insert mode		<Esc>
	four words back			     4b
	move on top of the "o"		       l
	replace with "a"			ra
	restart Insert mode			  A

Another way to do this: >

		<C-Left><C-Left><C-Left><C-Left><Right><Del>a<End>

<	four words back		     <C-Left><C-Left><C-Left><C-Left>
	move on top of the "o"			<Right>
	delete the "o"				       <Del>
	insert an "a"					    a
	go to end of the line				     <End>

This uses special keys to move around, while remaining in Insert mode.  This
resembles what you would do in a modeless editor.  It's easier to remember,
but takes more time (you have to move your hand from the letters to the cursor
keys, and the <End> key is hard to press without looking at the keyboard).
   These special keys are most useful when writing a mapping that doesn't
leave Insert mode.  The extra typing doesn't matter then.
   An overview of the keys you can use in Insert mode:

	<C-Home>	to start of the file
	<PageUp>	a whole screenful up
	<Home>		to start of line
	<S-Left>	one word left
	<C-Left>	one word left
	<S-Right>	one word right
	<C-Right>	one word right
	<End>		to end of the line
	<PageDown>	a whole screenful down
	<C-End>		to end of the file

There are a few more, see |ins-special-special|.

==============================================================================
*24.2*	Showing matches

When you type a ) it would be nice to see with which ( it matches.  To make
Vim do that use this command: >

	:set showmatch

When you now type a text like "(example)", as soon as you type the ) Vim will
briefly move the cursor to the matching (, keep it there for half a second,
and move back to where you were typing.
   In case there is no matching (, Vim will beep.  Then you know that you
might have forgotten the ( somewhere, or typed a ) too many.
   The match will also be shown for [] and {} pairs.  You don't have to wait
with typing the next character, as soon as Vim sees it the cursor will move
back and inserting continues as before.
   You can change the time Vim waits with the 'matchtime' option.  For
example, to make Vim wait one and a half second: >

	:set matchtime=15

The time is specified in tenths of a second.

==============================================================================

Title: Vim User Manual: Inserting Quickly - Corrections and Showing Matches
Summary
This section of the Vim user manual focuses on efficient text insertion techniques, including making corrections with backspace, delete, CTRL-W, and CTRL-U. It also covers using special keys for navigation within Insert mode. Additionally, it explains how to use the 'showmatch' option to highlight matching parentheses, brackets, and braces, and how to adjust the display time with the 'matchtime' option.