:%s/sofia/Sofia/g
High level explanation:
Using search and replace, search every line, find all occurrences of “sofia” on the line and replace with “Sofia”.
Broken down:
% – represents all the lines in the buffer
s – substitute
g – global (every match on the line)
You can also find and replace across multiple buffers with:
vim file1 file2 file3
then:
bufdo %s/sofia/Sofia/g
That will find and replace “sofia” with “Sofia” in all three files.
If you don’t have “set hidden” in your .vimrc file then you must then write your changes out, but you can use bufdo to do that too!
:bufdo! w
or, you can combine them into one command using the “|”
:bufdo s/sofia/Sofia/g | w




Recent Comments