开发者

vi editor : How to replace multiple tab by tab-space-tab

开发者 https://www.devze.com 2023-03-01 10:17 出处:网络
I have a text file which has two TABS consecutively. I need to insert a SPACE between those two TABS.

I have a text file which has two TABS consecutively. I need to insert a SPACE between those two TABS.

I am working on vi editor.开发者_运维知识库 Can anyone tell me how to do that.


Use :

:%s/\t\t/\t \t/g

Do you want to perform multiple substitution on each line?


To globally replace all instances of \t\t with \t \t

:g/\t\t/s//\t \t/g

or to replace the first instance on every line:

:g/\t\t/s//\t \t

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号