Vim 9 · Searching and replacing Replace in the whole file Replace every occurrence of old with new. :%s/old/new/g Official Vim 9 documentation More searching and replacing commands Search forwardSearch backwardSearch for the word under the cursorReplace with confirmationReplace in a selectionClear search highlighting All searching and replacing commands · Vim 9 cheatsheet ← Search for the word under the cursorReplace with confirmation →