如何输入与上一行字符数一样多的连字符?

How to input hyphen as many as the number of characters in the line above?

我想输入与上面一行中的字符数一样多的特定字符。

之前:

FooBar

之后:

FooBar
------

我想用这个函数写reStructuredText

yypVr-

拉出该行,粘贴它,然后将每个字符更改为破折号。