difference is that "as" includes the white space after the sentence and
"is" doesn't. If you would delete a sentence, you want to delete the white
space at the same time, thus use "das". If you want to type new text the
white space can remain, thus you use "cis".
You can also use text objects in Visual mode. It will include the text object
in the Visual selection. Visual mode continues, thus you can do this several
times. For example, start Visual mode with "v" and select a sentence with
"as". Now you can repeat "as" to include more sentences. Finally you use an
operator to do something with the selected sentences.
You can find a long list of text objects here: |text-objects|.
==============================================================================
*04.9* Replace mode
The "R" command causes Vim to enter replace mode. In this mode, each
character you type replaces the one under the cursor. This continues until
you type <Esc>.
In this example you start Replace mode on the first "t" of "text":
This is text. ~
Rinteresting.<Esc>
This is interesting. ~
You may have noticed that this command replaced 5 characters in the line with
twelve others. The "R" command automatically extends the line if it runs out
of characters to replace. It will not continue on the next line.
You can switch between Insert mode and Replace mode with the <Insert> key.
When you use <BS> (backspace) to make a correction, you will notice that the
old text is put back. Thus it works like an undo command for the previously
typed character.
==============================================================================
*04.10* Conclusion
The operators, movement commands and text objects give you the possibility to
make lots of combinations. Now that you know how they work, you can use N
operators with M movement commands to make N * M commands!
You can find a list of operators here: |operator|.
For example, there are many other ways to delete pieces of text. Here are a
few common ones:
x delete character under the cursor (short for "dl")
X delete character before the cursor (short for "dh")
D delete from cursor to end of line (short for "d$")
dw delete from cursor to next start of word
db delete from cursor to previous start of word
diw delete word under the cursor (excluding white space)
daw delete word under the cursor (including white space)
dG delete until the end of the file
dgg delete until the start of the file
If you use "c" instead of "d" they become change commands. And with "y" you
yank the text. And so forth.
There are a few common commands to make changes that didn't fit somewhere
else:
~ Change case of the character under the cursor, and move the
cursor to the next character. This is not an operator (unless
'tildeop' is set), thus you can't use it with a motion
command. It does work in Visual mode, where it changes case
for all the selected text.
I Start Insert mode after moving the cursor to the first
non-blank in the line.
A Start Insert mode after moving the cursor to the end of the
line.
==============================================================================
Next chapter: |usr_05.txt| Set your settings
Copyright: see |manual-copyright| vim:tw=78:ts=8:noet:ft=help:norl: