#7 fix - avoid enabling autoformat for code blocks

At least a partial fix for the problem of autoformat wreaking havoc on code blocks.

Couldn't find any highlighting groups for tables. If anybody can find them, we can add them to the exclude list.
This commit is contained in:
Reed Esau
2014-08-25 01:25:02 -06:00
parent 138a1c1dcf
commit a7996a75b5
3 changed files with 50 additions and 9 deletions

View File

@@ -30,6 +30,20 @@ if !exists('g:pencil#autoformat')
let g:pencil#autoformat = 1
en
if !exists('g:pencil#autoformat_exclude')
" by default, pencil does NOT start autoformat if inside any of
" the following syntax groups
let g:pencil#autoformat_exclude = [
\ 'markdownCode',
\ 'markdownHighlight[A-Za-z0-9]+',
\ 'mkdCode',
\ 'mkdIndentCode',
\ 'txtCode',
\ ]
en
let g:pencil#autoformat_exclude_re =
\ '(' . join(g:pencil#autoformat_exclude, '|') . ')'
if !exists('g:pencil#joinspaces')
" by default, only one space after full stop (.)
let g:pencil#joinspaces = 0