# 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' ~