mirror of
https://github.com/preservim/vim-pencil.git
synced 2025-11-15 21:33:47 -05:00
#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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user