AutoYADM commit: 2025-05-26 20:50:39
This commit is contained in:
parent
405e779c5e
commit
e9b8ab9717
3 changed files with 43 additions and 18 deletions
|
@ -1,10 +1,38 @@
|
|||
# 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 }
|
||||
|
||||
define-command -override -hidden true nop
|
||||
define-command -override -hidden false fail
|
||||
|
||||
declare-option -hidden bool autospell_enabled false
|
||||
define-command -docstring %{
|
||||
Enable autospell. Autospell refreshes spellchecks and hides spelling in insert mode.
|
||||
} autospell-enable %{
|
||||
try %{
|
||||
spell
|
||||
hook -group auto-spell window ModeChange (push|pop):.*insert %{
|
||||
try %{ spell-clear }
|
||||
}
|
||||
hook -group auto-spell window NormalIdle .* %{ try spell }
|
||||
} catch %{
|
||||
fail "Couldn't enable autospell!"
|
||||
}
|
||||
}
|
||||
|
||||
define-command -docstring %{
|
||||
Disable autospell. Autospell refreshes spellchecks and hides spelling in insert mode.
|
||||
} autospell-disable %{
|
||||
try spell-clear
|
||||
remove-hooks window auto-spell
|
||||
}
|
||||
|
||||
define-command autospell-toggle %{
|
||||
try %{
|
||||
%opt{autospell_enabled}
|
||||
autospell-disable
|
||||
} catch %{
|
||||
autospell-enable
|
||||
}
|
||||
hook -group auto-spell window NormalIdle .* %{ try spell }
|
||||
}
|
||||
|
||||
# keybindings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue