vim replace command
:%s/foo/bar/g
how to search replace in vim
-- How to search-replace (substitute) in vim --
:(RANGE)s/(SEARCH)/(REPLACE)/(GC)
(RANGE) can be
- Blank for just current line
- "Start, Stop" for line range, e.g. "4,8"
- "%" for whole file
(SEARCH) can be simple text or a regex (see source for details)
(REPLACE) should be obvious...
(GC)
- Appending "g" replaces all occurances, not just the first
- Appending "c" allows vim to confirm each replacement
They can be used together, separate, or not at all
linux vim replace all
%s/{the word you want to find}/{word to replaced with }/gc
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us