Add a spell replace function
This commit is contained in:
parent
dcebdd54f3
commit
52d1929d81
|
@ -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 }"
|
||||||
|
}}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user