diff --git a/.config/kak/autoload/email.kak b/.config/kak/autoload/email.kak index 68dfaaf8..30cd3235 100644 --- a/.config/kak/autoload/email.kak +++ b/.config/kak/autoload/email.kak @@ -6,9 +6,6 @@ hook global WinSetOption filetype=mail %~ hook -group mail-spell window ModeChange (push|pop):.*insert %{ try %{ spell-clear } } - # hook -group mail-spell window ModeChange (push|pop):insert:.* %{ - # try %{ spell } - # } hook -group mail-spell window NormalIdle .* %{ try spell } hook -group mail-auto-format window BufWritePre .* format hook -once -always window WinSetOption filetype=.* %{ diff --git a/.config/kak/autoload/spell.kak b/.config/kak/autoload/spell.kak new file mode 100644 index 00000000..3a42bbaa --- /dev/null +++ b/.config/kak/autoload/spell.kak @@ -0,0 +1,24 @@ +# spellcheck using aspell for now (maybe better options?) +provide-module spell %~ + define-command -hidden register-autospell %{ + hook -group auto-spell window ModeChange (push|pop):.*insert %{ + try %{ spell-clear } + } + hook -group auto-spell window NormalIdle .* %{ try spell } + } + + # keybindings + + declare-user-mode spell + + map -docstring 'show spell' global spell s ': spell' + map -docstring 'spell next' global spell n ': spell-next' + map -docstring 'spell next' global spell i ': spell-next' + map -docstring 'spell prev' global spell e ': spell-prev' + map -docstring 'spell prev' global spell m ': spell-prev' + map -docstring 'spell clear' global spell c ': spell-clear' + map -docstring 'spell add' global spell a ': spell-add' + map -docstring 'spell replace' global spell r ': spell-replace' + + map -docstring 'spelling' global user s ': enter-user-mode spell' +~ diff --git a/.config/kak/kakrc b/.config/kak/kakrc index a7b3004d..811b13d4 100644 --- a/.config/kak/kakrc +++ b/.config/kak/kakrc @@ -5,6 +5,7 @@ require-module fishr require-module surround require-module ficgrep require-module byline +require-module spell set-option global scrolloff 3,3 require-module ui-mode @@ -139,16 +140,3 @@ define-command goto-debug %{ map -docstring 'open debug buffer' global user D ':goto-debug' -# spellcheck using aspell for now (maybe better options?) -declare-user-mode spell - -map -docstring 'show spell' global spell s ': spell' -map -docstring 'spell next' global spell n ': spell-next' -map -docstring 'spell next' global spell i ': spell-next' -map -docstring 'spell prev' global spell e ': spell-prev' -map -docstring 'spell prev' global spell m ': spell-prev' -map -docstring 'spell clear' global spell c ': spell-clear' -map -docstring 'spell add' global spell a ': spell-add' -map -docstring 'spell replace' global spell r ': spell-replace' - -map -docstring 'spelling' global user s ': enter-user-mode spell'