diff --git a/rc/base/spell.kak b/rc/base/spell.kak index 4d496f77..2e8cb55c 100644 --- a/rc/base/spell.kak +++ b/rc/base/spell.kak @@ -53,3 +53,14 @@ Formats of language supported: } /dev/null 2>&1 & } } + +def spell-replace %{%sh{ + suggestions=$(echo "$kak_selection" | aspell -a | grep '^&' | cut -d: -f2) + menu=$(echo "${suggestions#?}" | awk -F', ' ' + { + for (i=1; i<=NF; i++) + printf "%s", "%{"$i"}" "%{exec -itersel c"$i"be}" + } + ') + printf '%s\n' "try %{ menu -auto-single $menu }" +}}