当前位置:网站首页>Replace, delete, insert in vim's column mode

Replace, delete, insert in vim's column mode

2022-09-23 08:51:06Jiangdong flower master Minming

First, the column mode of vim

Original content of the text:

insert image description here

I. Replacement

Method 1: Replace the content with the same characters

Objective: Replace #inc with aaa
Action: crtl+v press and hold j< in normal modeThe /code> key moves down to the last line to be replaced, the l key moves to the c sub-character, press the r key to replace, enter the replacement

insert image description here

Method 2: The replaced content is different

Objective: Replace #inc with abc
Action: crtl+v in normal mode press and hold j key moves down to the last line to be replaced, the l key moves to the c sub-character, and the c key is pressed to delete and insert.After entering the content directly, press the Esc key to enter the normal mode to complete the replacement.

insert image description here

Second, delete

Objective: Replace #inc to delete
Action: crtl+v in normal mode, hold down the j key to move downTo the last line to be replaced, move the l key to the c sub-character, and press the d key to delete
insert image description here

Three, insert content before or after characters

Objective: insert aaa before #inc and bbb after it
Action: crtl+v press and hold j< in normal modeThe /code> key moves down to the last line to be replaced, the l key moves to the c sub-character, and the shift + i key is pressed to selectInsert content before the selected character, and similarly, press shift + a to insert content after the selected character

insert image description here

原网站

版权声明
本文为[Jiangdong flower master Minming]所创,转载请带上原文链接,感谢
https://chowdera.com/2022/266/202209230842521479.html

随机推荐