Additional changes for #33, file type specific autoformat config

This commit is contained in:
Reed Esau
2015-09-07 12:18:19 -06:00
parent f89a3ac998
commit dd8321a2d5
3 changed files with 28 additions and 24 deletions

View File

@@ -62,8 +62,8 @@ if !exists('g:pencil#autoformat')
en
if !exists('g:pencil#autoformat_config')
" do not engage autoformat if cursor is inside any of
" the following syntax groups
" Do not activate autoformat if entering Insert mode when
" the cursor is inside any of the following syntax groups.
"
" markdown* (tpope/vim-markdown)
" mkd*, htmlH[0-9] (plasticboy/vim-markdown)
@@ -74,29 +74,16 @@ if !exists('g:pencil#autoformat_config')
let g:pencil#autoformat_config = {
\ 'markdown': {
\ 'black': [
\ 'markdown(Code|H[0-9]|Url|IdDeclaration|Link|Rule|Highlight[A-Za-z0-9]+)',
\ 'htmlH[0-9]',
\ 'markdown(Code|H[0-9]|Url|IdDeclaration|Link|Rule|Highlight[A-Za-z0-9]+)',
\ 'markdown(FencedCodeBlock|InlineCode)',
\ 'mkd(Code|Rule|Delimiter|Link|ListItem|IndentCode)',
\ 'mmdTable[A-Za-z0-9]*',
\ ],
\ 'white': [
\ 'markdown(Code|Link)',
\ ],
\ },
\ 'mkd': {
\ 'black': [
\ 'mkd(Code|Rule|Delimiter|Link|ListItem|IndentCode)',
\ 'htmlH[0-9]',
\ 'mmdTable[A-Za-z0-9]*',
\ ],
\ },
\ 'tex': {
\ 'black': [
\ 'tex(BeginEndName|Delimiter|DocType|InputFile|Math|RefZone|Title)',
\ 'texSection$',
\ ],
\ 'enforce-previous-line': 1,
\ },
\ 'asciidoc': {
\ 'black': [
\ 'asciidoc(AttributeList|AttributeEntry|ListLabel|Literal|SideBar|Source|Sect[0-9])',
@@ -112,6 +99,13 @@ if !exists('g:pencil#autoformat_config')
\ 'rst(CodeBlock|Directive|LiteralBlock|Sections)',
\ ],
\ },
\ 'tex': {
\ 'black': [
\ 'tex(BeginEndName|Delimiter|DocType|InputFile|Math|RefZone|Title)',
\ 'texSection$',
\ ],
\ 'enforce-previous-line': 1,
\ },
\ 'textile': {
\ 'black': [
\ 'txtCode',
@@ -119,6 +113,14 @@ if !exists('g:pencil#autoformat_config')
\ },
\ }
en
if !exists('g:pencil#autoformat_aliases')
" Aliases used exclusively for autoformat config.
" Pencil will NOT modify the filetype setting.
let g:pencil#autoformat_aliases = {
\ 'md': 'markdown',
\ 'mkd': 'markdown',
\ }
en
if !exists('g:pencil#joinspaces')
" by default, only one space after full stop (.)