vim copy and replace text

前端 未结 10 2226
名媛妹妹
名媛妹妹 2021-02-14 18:02

Lets say that i have this text:

$test = \'lorem\';
$test2= \'ipsum\';

and I want to copy lorem and paste into ipsum. I tried to do yi\' on lor

10条回答
  •  感情败类
    2021-02-14 18:50

    I usually go to the sed command.

    :%s/ipsum/lorem/g
    
    • % means do this for every line
    • s means sed, or search and replace
    • g at the end means replace every ipsum with lorem; if you omit this, it only replaces the first.

提交回复
热议问题