Add a spell replace function

This commit is contained in:
Dimitar Dimitrov 2016-10-20 12:31:06 +01:00
parent dcebdd54f3
commit 52d1929d81

View File

@ -54,3 +54,14 @@ Formats of language supported:
} </dev/null >/dev/null 2>&1 & } </dev/null >/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"<esc>be}"
}
')
printf '%s\n' "try %{ menu -auto-single $menu }"
}}