Swaroop C H
Swaroop C H

Reputation: 17034

How to make Vim continue bullet points?

When I use Mediawiki-syntax first-level bullet points, pressing enter key shows a bullet point for the next line as well:

* <CR>
*

But when I have the second-level bullet points, it just starts a new blank line

** <CR>
(blank line)

What option/expression do I have to change/program to make it put ** in the second line?


I have set autoindent in my vimrc, not sure if that is the one that does the repeating of * with the enter key.

Upvotes: 6

Views: 6258

Answers (2)

Maxim Kim
Maxim Kim

Reputation: 6392

Try

setlocal formatoptions=ctnqro
setlocal comments+=n:*,n:#

It works that way in vimwiki.

Upvotes: 7

Sam
Sam

Reputation: 15350

I think Vim should at least be able to do this if it interprets your bullet points as starting comments.

You can check :he 'comments' and :he format-comments to learn more about Vim's slightly tricky comment definitions.

You can at least get it working for two asterisks by doing :set comments+=:**. Also :se formatoptions? should include r

Upvotes: 1

Related Questions