diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2020-02-27 00:14:45 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2020-02-27 00:14:45 +0100 |
commit | dd2001c698c57c99fa471fc17575e7236a426548 (patch) | |
tree | e53a3c689e73e1c6804e90d44465ac8289f48c39 /init.lua | |
parent | 853221ace588fcf741d72db92f2c7668cf47d844 (diff) | |
download | vis-par-dd2001c698c57c99fa471fc17575e7236a426548.tar.gz |
The first attempt for init.lua
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 13 |
1 files changed, 13 insertions, 0 deletions
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)") + |