mirror of
https://github.com/preservim/vim-pencil.git
synced 2025-11-15 21:33:47 -05:00
Misc improvements
Additional undo points. Disable auto format by default. More keys that can wrap in insert mode.
This commit is contained in:
@@ -133,7 +133,7 @@ function! pencil#init(...) abort
|
|||||||
" global settings
|
" global settings
|
||||||
if b:wrap_mode
|
if b:wrap_mode
|
||||||
set display+=lastline
|
set display+=lastline
|
||||||
set backspace=indent,eol,start " via tpope/vim-sensible
|
set backspace=indent,eol,start
|
||||||
if g:pencil#joinspaces
|
if g:pencil#joinspaces
|
||||||
set joinspaces " two spaces after .!?
|
set joinspaces " two spaces after .!?
|
||||||
else
|
else
|
||||||
@@ -145,7 +145,7 @@ function! pencil#init(...) abort
|
|||||||
" other plugins, restrict its presence to buffer
|
" other plugins, restrict its presence to buffer
|
||||||
" Better: restore ve to original setting
|
" Better: restore ve to original setting
|
||||||
if b:wrap_mode && g:pencil#cursorwrap
|
if b:wrap_mode && g:pencil#cursorwrap
|
||||||
set whichwrap+=<,>,h,l,[,]
|
set whichwrap+=<,>,b,s,h,l,[,]
|
||||||
augroup pencil_cursorwrap
|
augroup pencil_cursorwrap
|
||||||
autocmd BufEnter <buffer> set virtualedit+=onemore
|
autocmd BufEnter <buffer> set virtualedit+=onemore
|
||||||
autocmd BufLeave <buffer> set virtualedit-=onemore
|
autocmd BufLeave <buffer> 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-=2 " use indent of 2nd line for rest of paragraph
|
||||||
setlocal formatoptions-=v " only break line at blank entered during insert
|
setlocal formatoptions-=v " only break line at blank entered during insert
|
||||||
setlocal formatoptions-=w " avoid erratic behavior if mixed spaces
|
setlocal formatoptions-=w " avoid erratic behavior if mixed spaces
|
||||||
|
setlocal formatoptions-=a " autoformat will turn on with Insert in HardPencil mode
|
||||||
else
|
else
|
||||||
setlocal autoindent< noautoindent<
|
setlocal autoindent< noautoindent<
|
||||||
setlocal list< nolist<
|
setlocal list< nolist<
|
||||||
@@ -223,6 +224,8 @@ function! pencil#init(...) abort
|
|||||||
inoremap <buffer> ? ?<c-g>u
|
inoremap <buffer> ? ?<c-g>u
|
||||||
inoremap <buffer> , ,<c-g>u
|
inoremap <buffer> , ,<c-g>u
|
||||||
inoremap <buffer> ; ;<c-g>u
|
inoremap <buffer> ; ;<c-g>u
|
||||||
|
inoremap <buffer> : :<c-g>u
|
||||||
|
inoremap <buffer> - -<c-g>u
|
||||||
inoremap <buffer> <c-u> <c-g>u<c-u>
|
inoremap <buffer> <c-u> <c-g>u<c-u>
|
||||||
inoremap <buffer> <c-w> <c-g>u<c-w>
|
inoremap <buffer> <c-w> <c-g>u<c-w>
|
||||||
else
|
else
|
||||||
@@ -231,6 +234,8 @@ function! pencil#init(...) abort
|
|||||||
silent! iunmap <buffer> ?
|
silent! iunmap <buffer> ?
|
||||||
silent! iunmap <buffer> ,
|
silent! iunmap <buffer> ,
|
||||||
silent! iunmap <buffer> ;
|
silent! iunmap <buffer> ;
|
||||||
|
silent! iunmap <buffer> :
|
||||||
|
silent! iunmap <buffer> -
|
||||||
silent! iunmap <buffer> <c-u>
|
silent! iunmap <buffer> <c-u>
|
||||||
silent! iunmap <buffer> <c-w>
|
silent! iunmap <buffer> <c-w>
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user