Add autowrap.kak providing auto word wrapping hook

This commit is contained in:
Maxime Coste 2015-07-24 14:00:29 +01:00
parent 6f337b254d
commit 71081f3823

9
rc/autowrap.kak Normal file
View File

@ -0,0 +1,9 @@
decl int autowrap_column 80
def autowrap-enable %{
hook -group autowrap window InsertChar [^\n] %{ try %{ exec -draft "<a-h><a-k>.{%opt{autowrap_column},}<ret><a-;>bi<ret><esc>xX<a-k>[^\n]+\n[^\n]<ret>kx;d" } }
}
def autowrap-disable %{
rmhooks window autowrap
}