Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This isn't a particularly important, but it's something I've been curious about for a while.

I write a lot of documentation using rST (Sphinx). This is how you write a heading:

My Awesome Heading

Lorem ipsum dolor...

I'm wondering if there's a clever way in vim to do that underline, rather than just rapidly pressing the equals key a dozen times.

share|improve this question
up vote 6 down vote accepted
" underline current line
share|improve this answer
A bit shorter: the default behavior for Y is the same as yy. – pandubear Dec 28 '13 at 7:21

One keypress shorter than Barton's solution. ;)

share|improve this answer
thx, this is going to my vimrc. – amdorra Dec 23 '13 at 4:26
Shifting is a keypress. You tied. :) – codelahoma Dec 28 '13 at 21:21



This copies and pastes the current line, then substitutes '=' for each character.

You can wrap this a macro or set up a function within .vimrc

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.