How to add a space or a string into the substitute expression?
1
I am trying Vim capabilities and stuck with this task - addition the incrementing number to the end of each line. Testing lines: text text text text text This command works partially: :let n=1 | g/text/s/$/=n/ | let n+=1 Result: text1 text2 text3 text4 text5 But I want to have space between the added numbers and the 'text'. The adding of space ' ' before the = doesn't work, because the = should be in the beginning of substitute expression, else it is not parsed as an expression, but inserted literally - text =n : :let n=1 | g/text/s/$/ =n/ | let n+=1 ### doesn't work as expected So, the questions: Is it possible to insert a string in the substitute expression? Like this (the n is the variable): s/$/string=n/ s/$/'string'=n/ or this: s...