Fandom

Vim Tips Wiki

Insert comment boxes in your code

1,624pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Tip 900 Printable Monobook Previous Next

created March 22, 2005 · complexity intermediate · author Ken Holm · version 5.7


Put this in your vimrc and you can have nicely aligned comment boxes:

map ,co O#====================================================================================================<CR>#<CR>#====================================================================================================<Esc>100\|Dkk100\|DjA

Note:

  • The above should all be on one line.
  • There is a space after the "A" at the end of the line above.
  • While in navigation mode use ,co to create a comment block.
  • The comment block will chop off at column 100.
  • It relies on having autoindent set.

CommentsEdit

This should have the same result, I believe:

map ,co O#<Esc>100A=<Esc>100\|D<CR>i#<CR><Esc>i##<Esc>100a=<Esc>100\|D<Esc>kA

Also on Fandom

Random Wiki