Replace and virtual replace mode

Replace mode behaves similarly to those times you accidentally press the Insert key on your keyboard and wonder why typing erases text. When working with replace mode, the text you type is placed over existing text (as opposed to moving the existing text in insert mode). This is great when you don't want to change the character count in the original line, for example.

Enter replace mode by hitting R:

You'll see --REPLACE-- in the status line. Now, you'll be replacing text as you type:

Hit Esc to exit replace mode and go back to normal mode.

You can press r to enter replace mode for a single character press before being switched back to normal mode.

Vim also provides virtual replace mode, which behaves similarly to replace mode, but operates in terms of screen real estate as opposed to characters in a file. The main noticeable differences include Tab replacing multiple characters (as opposed to a single character in replace mode) or Enter not creating an addition line, but moving onto the next line. You can enter virtual replace mode using gR, and you can read more about it by reading :help vreplace-mode.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.121.170