Maybe the title isn't to explicative; feel free to improve it.
I have the text below:
1. Intro |timetracking-intro|$
2. Uso |timetracking-usage|$
3. Comandi |timetracking-commands|$
I want to replace all space between the title and the tag with dots, but the first and the last, like this:
1. Intro ........ |timetracking-intro|$
2. Uso .......... |timetracking-usage|$
3. Comandi ...... |timetracking-commands|$
After an hour of attempts without success I can't understand this:
:s/\A\s\A/./gc
This match also the firts space after the word "intro". Why? I used \A to not match the first space! (in the picture I grouped,\(\A\s\A\)
but is the same).
:s/\(\A\zs\s\ze\A\)/./gc
but this regex match only alternate spaces, and match also the last space!!
I had also some more funny results... :-/
Can anyone explain me why and how to do what I want?
\A
means non-alphabetic character (:help \A
).