VIM: Adds autoload function for writing mode

Writing mode is to be used when I am writing prose rather than code, for
example markdown files or emails.

Currently, it enables spellcheck and adds insert mode mappings that add
undo points when certain punctuation is inserted, such as full stops or
commas.

Currently this is used for markdown files, emails and git commits
This commit is contained in:
Jonathan Hodgson 2020-09-26 23:05:38 +01:00
parent ec1e8d41f9
commit 33777548d5
4 changed files with 15 additions and 2 deletions

View file

@ -0,0 +1,12 @@
function! mine#functions#text() abort
" set spellchecking
set spell
" Add undo points when this punctuation is added
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
endfunction

View file

@ -0,0 +1 @@
call mine#functions#text()

View file

@ -1 +1 @@
setlocal spell
call mine#functions#text()

View file

@ -1 +1 @@
setlocal spell
call mine#functions#text()