Sometimes my global substitutions don't substitute all matches in a line. It is confirmed by the fact that I can see it when I do substitutions with confirmation, a match is found in a line with multiple possible matches, but then it goes to another line.
I use the g or gc parameters operating on the entire file with %.
On this file:
hello hello
hello
hello hello hello
hello
If I do %s/hello/goodbye/g I get:
goodbye hello
goodbye
goodbye hello hello
goodbye
All I have in my .vimrc about search/replace is:
set hlsearch
set ignorecase
set incsearch
vimrc. – romainl Apr 16 '16 at 14:50:echo &gdand what happens if you add a 2ndgflag like this:%s/hello/goodbye/ggor if you remove thegflag entirely? If the output of:echo &gdis1, try addingset nogdefaultat the end of yourvimrc. – user9433424 Apr 16 '16 at 15:27set nogdefaultlike you said and it works now, by the way. Thank you! – Nicolas Scotto Di Perto Apr 16 '16 at 18:22