I am editing restructuredtext files. I often need to put some charactors like \"=-`~\" in one line, and I want the length of the line match the previous line. How should I
When the cursor is placed on a long long line you could use something like
:s/\(.*\)/\=submatch(1) . nr2char(13) . repeat('=', strlen(submatch(1)))/
In order to make it more easy to do the substitution, I'd then use a map:
nmap __ :s/\(.*\)/\=submatch(1) . nr2char(13) . repeat('=', strlen(submatch(1)))/
So, you can underline the line where the cursor is on with typing __.