mirror of
https://github.com/preservim/vim-pencil.git
synced 2025-11-13 04:13:46 -05:00
<cr> as undo point; no comment leaders; misc doc changes
This commit is contained in:
@@ -93,7 +93,7 @@ let g:pencil#wrapModeDefault = 'hard' " or 'soft'
|
|||||||
|
|
||||||
augroup pencil
|
augroup pencil
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd FileType markdown call pencil#init()
|
autocmd FileType markdown,mkd call pencil#init()
|
||||||
autocmd FileType textile call pencil#init()
|
autocmd FileType textile call pencil#init()
|
||||||
autocmd FileType text call pencil#init({'wrap': 'hard'})
|
autocmd FileType text call pencil#init({'wrap': 'hard'})
|
||||||
augroup END
|
augroup END
|
||||||
|
|||||||
@@ -174,14 +174,16 @@ function! pencil#init(...) abort
|
|||||||
setlocal autoindent " needed by formatoptions=n
|
setlocal autoindent " needed by formatoptions=n
|
||||||
setlocal formatoptions+=n " recognize numbered lists
|
setlocal formatoptions+=n " recognize numbered lists
|
||||||
setlocal formatoptions+=1 " don't break line before 1 letter word
|
setlocal formatoptions+=1 " don't break line before 1 letter word
|
||||||
setlocal formatoptions+=t " autoformat of text
|
setlocal formatoptions+=t " autoformat of text (vim default)
|
||||||
setlocal formatoptions+=c " autoformat of comments
|
setlocal formatoptions+=c " autoformat of comments (vim default)
|
||||||
|
|
||||||
" clean out stuff we likely don't want
|
" clean out stuff we likely don't want
|
||||||
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
|
setlocal formatoptions-=a " autoformat will turn on with Insert in HardPencil mode
|
||||||
|
setlocal formatoptions-=r " don't insert comment leader
|
||||||
|
setlocal formatoptions-=o " don't insert comment leader
|
||||||
else
|
else
|
||||||
setlocal autoindent< noautoindent<
|
setlocal autoindent< noautoindent<
|
||||||
setlocal list< nolist<
|
setlocal list< nolist<
|
||||||
@@ -245,6 +247,7 @@ function! pencil#init(...) abort
|
|||||||
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>
|
||||||
|
inoremap <buffer> <cr> <c-g>u<cr>
|
||||||
else
|
else
|
||||||
silent! iunmap <buffer> .
|
silent! iunmap <buffer> .
|
||||||
silent! iunmap <buffer> !
|
silent! iunmap <buffer> !
|
||||||
@@ -254,6 +257,7 @@ function! pencil#init(...) abort
|
|||||||
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>
|
||||||
|
silent! iunmap <buffer> <cr>
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user