From 71081f3823da1af409c8111f20a021ca8b1b3b38 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 24 Jul 2015 14:00:29 +0100 Subject: [PATCH] Add autowrap.kak providing auto word wrapping hook --- rc/autowrap.kak | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 rc/autowrap.kak diff --git a/rc/autowrap.kak b/rc/autowrap.kak new file mode 100644 index 00000000..a55c1edf --- /dev/null +++ b/rc/autowrap.kak @@ -0,0 +1,9 @@ +decl int autowrap_column 80 + +def autowrap-enable %{ + hook -group autowrap window InsertChar [^\n] %{ try %{ exec -draft ".{%opt{autowrap_column},}bixX[^\n]+\n[^\n]kx;d" } } +} + +def autowrap-disable %{ + rmhooks window autowrap +}