From 5b8b96ccf16918765614724ca01d4e4362bc8028 Mon Sep 17 00:00:00 2001 From: Reed Esau Date: Mon, 17 Feb 2014 01:51:27 -0700 Subject: [PATCH] Misc improvements Additional undo points. Disable auto format by default. More keys that can wrap in insert mode. --- autoload/pencil.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/autoload/pencil.vim b/autoload/pencil.vim index 3ca333a..cb18c27 100644 --- a/autoload/pencil.vim +++ b/autoload/pencil.vim @@ -133,7 +133,7 @@ function! pencil#init(...) abort " global settings if b:wrap_mode set display+=lastline - set backspace=indent,eol,start " via tpope/vim-sensible + set backspace=indent,eol,start if g:pencil#joinspaces set joinspaces " two spaces after .!? else @@ -145,7 +145,7 @@ function! pencil#init(...) abort " other plugins, restrict its presence to buffer " Better: restore ve to original setting if b:wrap_mode && g:pencil#cursorwrap - set whichwrap+=<,>,h,l,[,] + set whichwrap+=<,>,b,s,h,l,[,] augroup pencil_cursorwrap autocmd BufEnter set virtualedit+=onemore autocmd BufLeave set virtualedit-=onemore @@ -168,6 +168,7 @@ function! pencil#init(...) abort setlocal formatoptions-=2 " use indent of 2nd line for rest of paragraph setlocal formatoptions-=v " only break line at blank entered during insert setlocal formatoptions-=w " avoid erratic behavior if mixed spaces + setlocal formatoptions-=a " autoformat will turn on with Insert in HardPencil mode else setlocal autoindent< noautoindent< setlocal list< nolist< @@ -223,6 +224,8 @@ function! pencil#init(...) abort inoremap ? ?u inoremap , ,u inoremap ; ;u + inoremap : :u + inoremap - -u inoremap u inoremap u else @@ -231,6 +234,8 @@ function! pencil#init(...) abort silent! iunmap ? silent! iunmap , silent! iunmap ; + silent! iunmap : + silent! iunmap - silent! iunmap silent! iunmap endif