Merge remote-tracking branch 'kurkale6ka/spell_replace'

This commit is contained in:
Maxime Coste 2016-10-29 11:51:02 +01:00
commit bd5c952d76

View File

@ -53,3 +53,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 }"
}}