From af65cf419706fa712fb239a38e76149299215ac3 Mon Sep 17 00:00:00 2001 From: Reed Esau Date: Sun, 12 Jan 2014 17:28:54 -0700 Subject: [PATCH] temporarily disabled cursorwrap, as ve=onemore breaks vim-quotable --- README.markdown | 5 ++++- autoload/pencil.vim | 6 ++++++ plugin/pencil.vim | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 339b560..9645914 100644 --- a/README.markdown +++ b/README.markdown @@ -195,9 +195,12 @@ a hard break. If you wish to retain the default Vim behavior, set the `cursorwrap` value to 0 in your `.vimrc`: ```vim -let g:pencil#cursorwrap = 1 " 0=disable, 1=enable +let g:pencil#cursorwrap = 0 " 0=disable, 1=enable ``` +NOTE: temporarily disabled by default while I research related bug in +vim-quotable. + ## Auto-detection via modeline Will the wrapping mode be detected accurately? Maybe. But you can improve diff --git a/autoload/pencil.vim b/autoload/pencil.vim index ebcd1ac..0739e67 100644 --- a/autoload/pencil.vim +++ b/autoload/pencil.vim @@ -140,16 +140,22 @@ function! pencil#init(...) abort 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 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 0d5c5c7..9a4622a 100644 --- a/plugin/pencil.vim +++ b/plugin/pencil.vim @@ -38,7 +38,7 @@ endif 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 + let g:pencil#cursorwrap = 0 endif " # Commands