I want to replace the lines :
https://www.dailymotion.com/video/whatever_1 # The Serie - S2 E4 - Grin and Bear It
https://www.dailymotion.com/video/whatever_2 # The Serie - S2 E3 - Betty's Wait Problem
https://www.dailymotion.com/video/whatever_3 # The Serie - S1 E21 - Secretaries Day
...
by these lines :
https://www.dailymotion.com/video/whatever_1 # The Serie - S2 E4 - whatever_79
https://www.dailymotion.com/video/whatever_2 # The Serie - S2 E3 - whatever_78
https://www.dailymotion.com/video/whatever_3 # The Serie - S1 E21 - whatever_77
...
So I tried different combinations of the following vim command :
:let i=79 | g/^http/s/\(S[0-9]\+ E[0-9]\+\).*$/\1 - whatever_\=i/ | let i=i-1
but none has worked and I got this instead :
https://www.dailymotion.com/video/whatever_1 # The Serie - S2 E4 - whatever_=i
https://www.dailymotion.com/video/whatever_2 # The Serie - S2 E3 - whatever_=i
https://www.dailymotion.com/video/whatever_3 # The Serie - S1 E21 - whatever_=i
Can you help me ?
\=
here. And just for fun...you could have repaired the lines all ending in '=i' by doing aCtrl+V
select of the last column (cursor on firstline then<c-v>}k$
) followed by:s//79/ | norm! gvojg<c-v><c-x>
(For<c-v>
,<c-x>
here you should enter actualCtrl+V
/Ctrl+X
chars).