tags:

views:

260

answers:

2

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.

+1  A: 

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

Sam
+3  A: 

Try

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

It works that way in vimwiki.

Maxim Kim
If he only adds n:* that should mean that its only a single * that counts as a comment line. And since that already works for him, he probably already has that in `comments`
Sam
Sam, just apply those commands on a new buffer -- you'll see double stars just work.
Maxim Kim
Ah yeah it does work, I misunderstood how the n flag worked.
Sam