aboutsummaryrefslogtreecommitdiff
path: root/vim/.vim/autoload/dyamon/spell.vim
blob: 745a8fc2efd25aec1ae665a91186f1be28d6b7bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
" Autoload functions for spell checking.
" Last Changed: 2021-04-21
" Author: Federico Igne <>
" License: This file is placed in the public domain.

" Note: the functions takes an `errors` parameter to be compatible with
" the hook functionality in vim-grammarous. This parameter is not
" currently used.
function! dyamon#spell#on(errors) abort
    " "Turn off" colorscheme
    colorscheme off
    " Set spell checking
    set spell
endfunction

function! dyamon#spell#off(errors) abort
    " Reset spell checking
    set nospell
    " Reset colorscheme
    colorscheme gruvbox
endfunction

function! dyamon#spell#toggle() abort
    if &spell
        call dyamon#spell#off([])
    else
        call dyamon#spell#on([])
    endif
endfunction