Last active
January 30, 2017 05:41
-
-
Save canabady/89fee9ab45bcb220611455f987871bb7 to your computer and use it in GitHub Desktop.
Vim Tips: replace last occurrence in line
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
The easiest way would be to allow arbitrary text in front of the match, and specify the matched region using \zs: | |
:%s/.*\zsone/two/ | |
To change a line till the last of occurence of word 'one' in it | |
c/.*\zsone/e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment