Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The help says that virtual replace mode commands in Vim gr & GR replace characters in screen estate and not in file.

:help Virtual-Replace-mode

I am understanding this as something like changing the characters on the display but not in the buffer itself. Is that right? It seems incorrect.

I can use an explanation and probably a scenario or an example where this feature is relevant.

share|improve this question

migrated from serverfault.com May 24 '13 at 12:19

This question came from our site for system and network administrators.

up vote 9 down vote accepted

In Virtual-Replace-Mode the Buffer is harder fixed to its origin position.

1. Hello World
         ^ Cursor
2. I like cheese
3. And beer

When entering normal replace mode and hitting Internet<CR>And others the new buffer will be like this:

1. Hello Internet
2. And others
3. I like cheese
4. And beer

When doing the same in Virtual-Replace the result will be

1. Hello Internet
2. And othersese
3. And beer

Another example (tabstop=2;sts=0):

1. 012345678901234567890
2. Hello beautiful World
         ^ Cursor

Pressed keys: <Tab><Tab>

Replace-Mode result:

1. 012345678901234567890
2. Hello     autiful World

Virtual-Replace-Mode result:

1. 012345678901234567890
2. Hello     tiful World

Because in Replace mode the replacement is done char by char, where Tab is one char, no matter how many chars are displayed. In Virtual-Replace-Mode visible length of the Tab (:h 'ts', :h 'sts') is used to replace the chars.

share|improve this answer
(Did any characters get eaten up by comment formatting, some quoted strings look like they miss text, to me). Anyway, the last paragraph helped a lot. Im pretty sure I get it now :) Thanks a ton @krissi ! – sri May 24 '13 at 13:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.