Skip to content

Vim

Commands

Text processing

Replace the word in vim

<Esc>:%s/regular_expression/replacement/g<Enter>

Replace the word in vim from line 10 to line 15

<Esc>:10,15s/regular_expression/replacement/g<Enter>

Replace the word with case sensitive in vim

<Esc>:%s/\Cregular_expression/replacement/g<Enter>

Add a new character at the end of the line

<Esc>:%s/$/,<Enter>
Back to top