I'm looking for a way to replace the text

print("This is a test")



i.e. i want to overwrite every character of a text object (the string inside quotes) or up to a movement command by the same replacement character (asterisk in this case).

What would be the quickest/easiest way to do that?


You can do it with visual selection and than the r command. Like:


-> Visual select the part within the quotes and replace all chars with a *.

For movements I don't know a direct way, but you can do it also via selection:


-> Visual select three words and replace all selected chars with *.

  • Thanks so much! I didn't know that r in visual mode will replace everything selected, cool. – fschoenm May 5 '20 at 12:02
  • 1
    @fschoenm makes it really easy to create borders: yypVr-, for example – D. Ben Knoble May 5 '20 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.