Tech and travel

Replace last occurrence of a character in vim

2013-06-03

This stackoverflow post has a cool way to remove the last occurrence of a character in vim :

:%s/.*\zs,/|/

This replaces the last occurrence of a comma with a pipe. Other examples can be found on the vim wikia.

Copyright (c) 2024 Michel Hollands