I am using the following Vim command line that inserts line numbers to the beginning of lines:
:let i = 1 | %s/^/\='LINE_' . Inc()/g
Inc() is a function that increments the i variable.
This is all working fine. My questions:
1) What does the dot do in the replacement part?:
:let i = 1 | %s/^/\='LINE_' . Inc()/g
^
2) What does the pipe character do? Is there actual piping going on, or is it just syntax?
3) What does the \= do? I think it is used to call the function, but Vim help only shows information for \= as being a quantifier in regex.
4) I have not been able to insert a space after the line number and the first character of the actual line. How can I do this? Anything I place after Inc() in the replacement part is either being ignored or causing an E15 invalid expression error.
I am using Vim 7.3 on Windows 7.
CTRL-D. For example type:h \=<C-D>to see all the help tags that contain\=. In this case:s\=is the right one and you can find lots more information there.\=expression, it was present within the application's help file, but I did not know how to access it. Thanks so much.