Numbered Markdown Lists with Vim

I use vim to write Markdown. When I type this:

1. test
2. test

Vim annoys and formats it like this:

1. test 2. test

My formatoptions( tqlna) includes n. File type markdown. The listpat format is as follows:

setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+

Some of them seem to work, because Vim understands that it should not reformat lists starting with -, *or +.

How can i fix this?

+3
source share
2 answers

- want formatoptions, , ​​. , . , w , , , . want, , , Vim .

: http://blog.ezyang.com/2010/03/vim-textwidth/

" fo = RST- . ."

0

, vim , +, * -. , vim ( gq ). a formatoptions vim , , .

n formatlistpat, , textwidth . , gq, .

, formatprg, , . a . , a formatoptions gq .

[-*+] . ,

setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+
+2

All Articles