This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
search and replace | |
------------------- | |
s/foo/bar/g changes each 'foo' to 'bar' in the current line. | |
:%s/foo/bar/g changes each 'foo' to 'bar' in all lines. | |
:5,12s/foo/bar/g changes each 'foo' to 'bar' for all lines between line 5 and line 12. | |
:'a,'bs/foo/bar/g changes each 'foo' to 'bar' for all lines between marks a and b. | |
:.,$s/foo/bar/g changes each 'foo' to 'bar' for all lines between the current line (.) and the last line ($). | |
:.,+2s/foo/bar/g changes each 'foo' to 'bar' for the current line (.) and the two next lines (+2). | |
:%s is equivalent to :1,$s |