Support Conceal for Markdown; disable smartindent

This commit is contained in:
Reed Esau
2014-08-21 21:55:18 -06:00
parent 096dd965d7
commit 55b4a6e690
3 changed files with 207 additions and 168 deletions

View File

@@ -6,7 +6,7 @@
" License: The MIT License (MIT)
" ============================================================================
"
if exists('g:loaded_pencil') || &cp | finish | endif
if exists('g:loaded_pencil') || &cp | fini | en
let g:loaded_pencil = 1
" Save 'cpoptions' and set Vim default to enable line continuations.
@@ -17,53 +17,60 @@ if !exists('g:pencil#wrapModeDefault')
" user-overridable default, if detection fails
" should be 'soft' or 'hard' or 'off'
let g:pencil#wrapModeDefault = 'hard'
endif
en
if !exists('g:pencil#textwidth')
" textwidth used when in hard linebreak mode
let g:pencil#textwidth = 74
endif
en
if !exists('g:pencil#autoformat')
" by default, automatically format text when in Insert mode
" with hard wrap.
let g:pencil#autoformat = 1
endif
en
if !exists('g:pencil#joinspaces')
" by default, only one space after full stop (.)
let g:pencil#joinspaces = 0
endif
en
if !exists('g:pencil#cursorwrap')
" by default, h/l and cursor keys will wrap around hard
" linebreaks. Set to 0 if you don't want this behavior
let g:pencil#cursorwrap = 1
endif
en
if !exists('g:pencil#conceallevel')
" by default, concealing capability in your syntax plugin
" will be enabled. See tpope/vim-markdown for example.
" Set to 0 if you don't want this behavior
let g:pencil#conceallevel = 2
en
if !exists('g:pencil#softDetectSample')
" if no modeline, read as many as this many lines at
" start of file in attempt to detect at least one line
" whose byte count exceeds g:pencil#softDetectThreshold
let g:pencil#softDetectSample = 20
endif
en
if !exists('g:pencil#softDetectThreshold')
" if the byte count of at least one sampled line exceeds
" this number, then pencil assumes soft line wrapping
let g:pencil#softDetectThreshold = 130
endif
en
" # Commands
command -nargs=0 HardPencil call pencil#init({'wrap': 'hard'})
command -nargs=0 SoftPencil call pencil#init({'wrap': 'soft'})
command -nargs=0 DropPencil call pencil#init({'wrap': 'off' })
command -nargs=0 NoPencil call pencil#init({'wrap': 'off' })
command -nargs=0 TogglePencil call pencil#init({'wrap': 'toggle'})
" # coms
com -nargs=0 HardPencil call pencil#init({'wrap': 'hard'})
com -nargs=0 SoftPencil call pencil#init({'wrap': 'soft'})
com -nargs=0 DropPencil call pencil#init({'wrap': 'off' })
com -nargs=0 NoPencil call pencil#init({'wrap': 'off' })
com -nargs=0 TogglePencil call pencil#init({'wrap': 'toggle'})
command -nargs=0 AutoPencil call pencil#setAutoFormat(1)
command -nargs=0 ManualPencil call pencil#setAutoFormat(0)
command -nargs=0 ShiftPencil call pencil#setAutoFormat(-1)
com -nargs=0 AutoPencil call pencil#setAutoFormat(1)
com -nargs=0 ManualPencil call pencil#setAutoFormat(0)
com -nargs=0 ShiftPencil call pencil#setAutoFormat(-1)
let &cpo = s:save_cpo
unlet s:save_cpo