Vim Recall繁體中文

Use Virtual Replace for aligned text

gRHi<Esc>

Example

Normal mode on a literal tab followed by | value. The tab stop is 8 columns.

Before
	| value
Cursor on line 1, column 1
  1. gR Virtual Replace mode
  2. Hi<Esc> Hi takes the first two columns. The divider stays in column 9.
After
Hi	| value
Cursor on line 1, column 2
Details & Vim help

Replace by screen columns to keep text aligned when a tab or wide character spans several columns.

Overwrite a label in column-aligned text.

On this line, ordinary R replaces the tab and the divider. Virtual Replace keeps the divider in its original screen column. It requires +vreplace.

Try it in Vim

  1. On a line containing a literal tab followed by | value, place the cursor on the tab and type gR.
  2. Type Hi.
  3. Press <Esc> to return to Normal mode.