Search and Replace in Vim

Reading time: 1 min Written by Marco Tschannett

Searching and replacing text in a document is a common task. While programming we usually try to use refactring capabilities of our editors. Sometimes this is not feasable.

Disclaimer: This is part of my vim commands “repo”. I use this posts to archive solutions for text editiong problems I faced while using vim. To listen all shortcuts look here.


I want to search and replace a or all occurances of a phrase in the current file.


    # Einzlenes Ergebnis ersetzen

    #Alle Ergebnisse ersetzen


The search phrase will be interpreted as a regular expression. Reserved expressions like a . or a \ must therefore be escaped.


comments powered by Disqus