diff --git a/autoload/pencil.vim b/autoload/pencil.vim index 0739e67..e727ba1 100644 --- a/autoload/pencil.vim +++ b/autoload/pencil.vim @@ -49,8 +49,8 @@ function! pencil#setAutoFormat(mode) let b:last_autoformat = a:mode == -1 ? !b:last_autoformat : a:mode if b:last_autoformat augroup pencil_autoformat - autocmd InsertEnter set formatoptions+=a - autocmd InsertLeave set formatoptions-=a + autocmd InsertEnter set formatoptions+=aw + autocmd InsertLeave set formatoptions-=aw augroup END else silent! autocmd! pencil_autoformat * @@ -131,31 +131,22 @@ function! pencil#init(...) abort setlocal formatoptions+=1 " don't break line before 1 letter word setlocal formatoptions+=t 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 setlocal whichwrap+=<,>,h,l,[,] setlocal virtualedit+=onemore " could break other plugins endif - "setlocal cpoptions+=q " leave cursor at position when joining two lines - " clean out stuff we likely don't want setlocal formatoptions-=2 setlocal formatoptions-=v - setlocal formatoptions-=w " trailing whitespace continues paragraph - "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 + setlocal formatoptions-=w " trailing whitespace continues paragraph (will enable in insert mode) else setlocal autoindent< noautoindent< setlocal list< nolist< setlocal wrapmargin< setlocal display< setlocal formatoptions< - "setlocal cpoptions< setlocal whichwrap< setlocal virtualedit< endif diff --git a/plugin/pencil.vim b/plugin/pencil.vim index 9a4622a..85ec68f 100644 --- a/plugin/pencil.vim +++ b/plugin/pencil.vim @@ -36,9 +36,9 @@ if !exists('g:pencil#joinspaces') endif 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 - let g:pencil#cursorwrap = 0 + let g:pencil#cursorwrap = 1 endif " # Commands