diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2020-07-01 11:53:20 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2020-07-01 11:53:20 +0200 |
commit | 473e2ce3c752d375dcff71e5d93da04986c089a5 (patch) | |
tree | d2e0a25dd920c66f150794c01bdcd6680259239f /init.lua | |
parent | 842236f61a04016d68db42ea662104df9e2914e6 (diff) | |
download | vis-par-473e2ce3c752d375dcff71e5d93da04986c089a5.tar.gz |
Make program used for formatting configurable
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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) |