Replace Text In Current Line In Vim

Check Date

Works on 2019-01-22 22:38:34 +0800

Question

How to replace text in current line in Vim

Answer

:s/foo/bar/g

Find each occurrence of ‘foo’ (in the current line only), and replace it with ‘bar’.

Reference

Published 22 Jan 2019

Bring the answer to lost vistor
MagicRabbit on Twitter