diff --git a/README.markdown b/README.markdown index 2be8ece..b2c88db 100644 --- a/README.markdown +++ b/README.markdown @@ -19,7 +19,7 @@ smooth the path to writing prose. * Agnostic on soft line wrap _versus_ hard line breaks, supporting both * Auto-detects wrap mode via modeline and sampling * Adjusts navigation key mappings to suit the wrap mode -* Creates undo points on common punctuation +* Creates undo points on common punctuation, line and word deletion * When using hard line breaks, enables autoformat while inserting text * Buffer-scoped configuration (with a few minor exceptions, _pencil_ preserves your global settings) diff --git a/autoload/pencil.vim b/autoload/pencil.vim index b600786..3ca333a 100644 --- a/autoload/pencil.vim +++ b/autoload/pencil.vim @@ -215,19 +215,24 @@ function! pencil#init(...) abort silent! unmap endif - " set undo points around common punctuation + " set undo points around common punctuation, + " line and word deletions if b:wrap_mode - inoremap . .u - inoremap ! !u - inoremap ? ?u - inoremap , ,u - inoremap ; ;u + inoremap . .u + inoremap ! !u + inoremap ? ?u + inoremap , ,u + inoremap ; ;u + inoremap u + inoremap u else silent! iunmap . silent! iunmap ! silent! iunmap ? silent! iunmap , silent! iunmap ; + silent! iunmap + silent! iunmap endif endfunction