Skip to content

Instantly share code, notes, and snippets.

@canabady
Last active January 30, 2017 05:41
Show Gist options
  • Save canabady/89fee9ab45bcb220611455f987871bb7 to your computer and use it in GitHub Desktop.
Save canabady/89fee9ab45bcb220611455f987871bb7 to your computer and use it in GitHub Desktop.
Vim Tips: replace last occurrence in line
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