From 405e779c5e6a709c456ee2fc840809fbc78fb87d Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Mon, 26 May 2025 20:34:39 -0400 Subject: [PATCH] AutoYADM commit: 2025-05-26 20:34:39 --- .config/kak/autoload/email.kak | 3 --- .config/kak/autoload/spell.kak | 24 ++++++++++++++++++++++++ .config/kak/kakrc | 14 +------------- 3 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 .config/kak/autoload/spell.kak 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'