vim - Indentation with "#." start of paragraph -


when type "1. blah blah blah" vim recognizes "1." prefix , indents rest of paragraph tidy.

i configure vim same thing "#." literal prefix, since rest files autonumbers paragraphs when started "#.".

help!.

this controlled 'formatlistpat' option. :help 'formatlistpat':

a pattern used recognize list header. used "n" flag in 'formatoptions'.

so, need add branch #. in ~/.vimrc, e.g. (using :let instead of :set avoid escaping of backslashes):

let &formatlistpat = '^\s*\%(\d\+\|#\)[\]:.)}\t ]\s*' 

additionally, of course need have n flag in 'formatoptions':

setlocal formatoptions+=n