If you need to append some text to both the ends of a string in vi, use the following command in vi:
:/^\(.*\)/s//starttextcomeshere \1 endtextcomeshere/
If "iamworthless" is the text at the position of the cursor in the vi editor, the output of the command:
:/^\(.*\)/s//DONTFEEL \1 ANYTIME/
DONTFEEL iamworthless ANYTIME
As you guessed, "DONTFEEL " and " ANYTIME" are the strings you would like to crush "iamworthless" with. The "\1" is the variable that stores the entire pattern searched by
the "/\(.*\)/"
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment