Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Vim continue bullet points?

Tags:

vim

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.

like image 988
Swaroop C H Avatar asked Jun 26 '09 04:06

Swaroop C H


2 Answers

Try

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

It works that way in vimwiki.

like image 93
Maxim Kim Avatar answered Sep 21 '22 10:09

Maxim Kim


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

like image 37
Sam Avatar answered Sep 25 '22 10:09

Sam