Is there a way to easily create a text header in VI? I would like to create a header such as the one below without having to count characters for the purpose of centering.
# ********** a centered title **********
Any vi voodoo to be had? A better method?
You can center the current line by using :center (in vim). Then use ‘R’ to fill in the asterisks after the fact. Still not fast or magical, but at least it saves you from counting characters.
So the steps would be:
Upon further testing, you need to have “set expandtab” turned on, otherwise centering will use tabstops and you end up replacing them with single characters which undoes the centering.