Skip to content
This repository was archived by the owner on Apr 6, 2018. It is now read-only.
This repository was archived by the owner on Apr 6, 2018. It is now read-only.

Implement Replace mode #562

@andyearnshaw

Description

@andyearnshaw

Please add replace mode as per:

vim -c "help Replace"
  1. Replace mode Replace Replace-mode mode-replace

Enter Replace mode with the "R" command in normal mode.

In Replace mode, one character in the line is deleted for every character you
type. If there is no character to delete (at the end of the line), the
typed character is appended (as in Insert mode). Thus the number of
characters in a line stays the same until you get to the end of the line.
If a is typed, a line break is inserted and no character is deleted.

Be careful with characters. If you type a normal printing character in
its place, the number of characters is still the same, but the number of
columns will become smaller.

If you delete characters in Replace mode (with , CTRL-W, or CTRL-U), what
happens is that you delete the changes. The characters that were replaced
are restored. If you had typed past the existing text, the characters you
added are deleted. This is effectively a character-at-a-time undo.

If the 'expandtab' option is on, a will replace one character with
several spaces. The result of this is that the number of characters in the
line increases. Backspacing will delete one space at a time. The original
character will be put back for only one space that you backspace over (the
last one). {Vi does not have the 'expandtab' option}

It's quite a major omission IMO, especially given that there is no equivalent (ie, insert/overtype mode).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions