Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个文件,其中包含多个这样的条目:
Abcd:abcd:*sometext*:klm:xyz/abc Abcd:abcd:R%fs90uw:klm:xyz/abc
现在,我只想将那些行中包含“ sometext ”字符串的行替换为“klm”。
如何使用 vim 中的搜索和替换功能来做到这一点?
谢谢!
:g是你的朋友:
:g
:g/sometext/s/klm/qrs/g