Vim Tips Wiki
Advertisement
Tip 750 Printable Monobook Previous Next

created June 18, 2004 · complexity intermediate · author Chris X Edwards · version 5.7


This tip takes a line of text like this:

A Very Important Tip!!!

and changes it to two lines like this:

A Very Important Tip!!!
-----------------------

This is particularly useful to highlight headings.

Add this to your vimrc file:

" Underline the current line with dashes
map <F5> yyp<c-v>$r-

Note that you can use anything you want instead of - (= and _ spring to mind).

In case you want to get a line above AND below the target text, do this:

<F5>yykP

Comments


Advertisement