I cannot add comment to previous answer, so I decided to post my own.
As it's already been mentioned, you should use 'g' flag to replace all occurrences. But for :s/X/Y/cg
it will still replace only in current line. Reference from :help :s
4.2 Substitute *:substitute*
*:s* *:su*
:[range]s[ubstitute]/{pattern}/{string}/[flags] [count]
......
When [range] and [count] are omitted, replace in the
current line only.
......
You can specify range after colon symbol, like %
(:%s/X/Y/cg
), to replace in the whole file. Or you can specify range from current line to document's end by .,$
(:.,$s/X/Y/cg
). More about ranges you can see in :help :range
: