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:
parent
b7b2422a3e
commit
cf0b27ee26
4 changed files with 15 additions and 2 deletions
12
nvim/.config/nvim/autoload/mine/functions.vim
Normal file
12
nvim/.config/nvim/autoload/mine/functions.vim
Normal 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
|
1
nvim/.config/nvim/ftplugin/gitcommit.vim
Normal file
1
nvim/.config/nvim/ftplugin/gitcommit.vim
Normal file
|
@ -0,0 +1 @@
|
|||
call mine#functions#text()
|
|
@ -1 +1 @@
|
|||
setlocal spell
|
||||
call mine#functions#text()
|
||||
|
|
|
@ -1 +1 @@
|
|||
setlocal spell
|
||||
call mine#functions#text()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue