From dd2001c698c57c99fa471fc17575e7236a426548 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Thu, 27 Feb 2020 00:14:45 +0100 Subject: The first attempt for init.lua --- init.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 init.lua diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..9c9cd38 --- /dev/null +++ b/init.lua @@ -0,0 +1,13 @@ +require('vis') + +vis:operator_new("gq", function(file, range, pos) + local status, out, err = vis:pipe(file, range, "fmt -w 65") + if not status then + vis:info(err) + else + file:delete(range) + file:insert(range.start, out) + end + return range.start -- new cursor location +end, "Formating operator, filter range through fmt(1)") + -- cgit