restored cursorwrap default; fixed autoformat issue for quotable

This commit is contained in:
Reed Esau
2014-01-12 21:24:16 -07:00
parent 5b3a7d35c0
commit fd6f590d4a
2 changed files with 5 additions and 14 deletions

View File

@@ -49,8 +49,8 @@ function! pencil#setAutoFormat(mode)
let b:last_autoformat = a:mode == -1 ? !b:last_autoformat : a:mode let b:last_autoformat = a:mode == -1 ? !b:last_autoformat : a:mode
if b:last_autoformat if b:last_autoformat
augroup pencil_autoformat augroup pencil_autoformat
autocmd InsertEnter <buffer> set formatoptions+=a autocmd InsertEnter <buffer> set formatoptions+=aw
autocmd InsertLeave <buffer> set formatoptions-=a autocmd InsertLeave <buffer> set formatoptions-=aw
augroup END augroup END
else else
silent! autocmd! pencil_autoformat * <buffer> silent! autocmd! pencil_autoformat * <buffer>
@@ -131,31 +131,22 @@ function! pencil#init(...) abort
setlocal formatoptions+=1 " don't break line before 1 letter word setlocal formatoptions+=1 " don't break line before 1 letter word
setlocal formatoptions+=t setlocal formatoptions+=t
setlocal formatoptions+=n " recognize numbered lists setlocal formatoptions+=n " recognize numbered lists
"setlocal formatoptions+=b " investigate this
"setlocal formatoptions+=m " investigate this
"setlocal formatoptions+=MB " investigate this
if g:pencil#cursorwrap if g:pencil#cursorwrap
setlocal whichwrap+=<,>,h,l,[,] setlocal whichwrap+=<,>,h,l,[,]
setlocal virtualedit+=onemore " could break other plugins setlocal virtualedit+=onemore " could break other plugins
endif endif
"setlocal cpoptions+=q " leave cursor at position when joining two lines
" clean out stuff we likely don't want " clean out stuff we likely don't want
setlocal formatoptions-=2 setlocal formatoptions-=2
setlocal formatoptions-=v setlocal formatoptions-=v
setlocal formatoptions-=w " trailing whitespace continues paragraph setlocal formatoptions-=w " trailing whitespace continues paragraph (will enable in insert mode)
"setlocal cpoptions-=J " allow tab to be recognized as white space following sentence
"setlocal cpoptions-=j " .!? all have same join behavior
"setlocal cpoptions-=n " exclude number from text of wrapped lines
else else
setlocal autoindent< noautoindent< setlocal autoindent< noautoindent<
setlocal list< nolist< setlocal list< nolist<
setlocal wrapmargin< setlocal wrapmargin<
setlocal display< setlocal display<
setlocal formatoptions< setlocal formatoptions<
"setlocal cpoptions<
setlocal whichwrap< setlocal whichwrap<
setlocal virtualedit< setlocal virtualedit<
endif endif

View File

@@ -38,7 +38,7 @@ endif
if !exists('g:pencil#cursorwrap') if !exists('g:pencil#cursorwrap')
" by default, h/l and cursor keys will wrap around hard " by default, h/l and cursor keys will wrap around hard
" linebreaks. Set to 0 if you don't want this behavior " linebreaks. Set to 0 if you don't want this behavior
let g:pencil#cursorwrap = 0 let g:pencil#cursorwrap = 1
endif endif
" # Commands " # Commands