I have a list of words:
bau
ceu
diu
fou
gau
I want to turn that list into:
byau
cyeu
dyiu
fyou
gyau
I unsuccessfully tried the command:
:%s/(\w)(\w\w)/\1y\2/g
Given that this doesn't work, what do I have to change to make the regex capture groups work in Vim?
:%norm ay<CR>
. – romainl Nov 11 '13 at 9:12l
, enter Visual Block mode withCtrl+v
, mark whole column withShift+g
followed byl
, then enter Insert mode withShift+i
and input 'y'. 7 keystrokes including finishingEsc
to exit Insert mode. Not posting as an answer because it's not really about capture groups (which is what I searched for when I found this). :-) – LIttle Ancient Forest Kami Aug 21 '16 at 11:23