I often write text with format like this in VIM

My talking points:

- talking point 1

- talking point 2 ....
continue on point 2

Ideally, I would hope VIM can auto align it for me such as:


- talking point 1

- talking point 2 
  continue on point 2

Is this possible?

thanks

Oliver

link|improve this question
feedback

3 Answers

up vote 0 down vote accepted

I've got this in my .vimrc:

set comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-,fb:[+],fb:[x],fb:[-]

If I remember correct, add this line in your .vimrc and the job will be done:

set comments +=fb:-

For a detailed explanation try:

:help comments
link|improve this answer
feedback
:set smartindent

if you need vim to break the line earlier than add

:set tw=30

or whatever number of chars per line you need.

link|improve this answer
feedback

See also: http://www.adp-gmbh.ch/vim/formatting/indenting_bullets.html

But also make sure that smartindent/cindent are not also set.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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