Tuesday, May 8, 2012

Vim : replacing text with matched text

For e.g. If my input is : 
$this->Lang("abc");
$this->Lang("kkk");

and I want to make it : 
"abc";
"kkk";

then : 
:1,$ s/$this->Lang(\(.*\))/\1/

\1 denotes the text matched between first \( \)

No comments:

Blog Archive