From 473e2ce3c752d375dcff71e5d93da04986c089a5 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Wed, 1 Jul 2020 11:53:20 +0200 Subject: Make program used for formatting configurable --- init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index a3cbbc9..8d5582b 100644 --- a/init.lua +++ b/init.lua @@ -1,7 +1,9 @@ require('vis') +par_prg = nil vis:operator_new("gq", function(file, range, pos) - local status, out, err = vis:pipe(file, range, "fmt -c -w 65") + local prg = (par_prg ~= nil) and par_prg or "fmt -c -w 65" + local status, out, err = vis:pipe(file, range, prg) -- local status, out, err = vis:pipe(file, range, "par -w 65") if not status then vis:info(err) -- cgit