summaryrefslogtreecommitdiff
path: root/config/vis/visrc.lua
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-05-22 11:17:26 -0500
committerMarc Coquand <marc@mccd.space>2024-05-22 11:17:26 -0500
commit57777a1aa586f23d9060596f8ac70ef3830e6d0c (patch)
treed448a7e48e2f099536bed959146b6ac5208c1f87 /config/vis/visrc.lua
parentfa33bc3764c0c76cf05aa5ba1f2af13019dc81e1 (diff)
downloadrcm-57777a1aa586f23d9060596f8ac70ef3830e6d0c.tar.gz
rcm-57777a1aa586f23d9060596f8ac70ef3830e6d0c.tar.bz2
rcm-57777a1aa586f23d9060596f8ac70ef3830e6d0c.zip
Add vis
Diffstat (limited to '')
-rw-r--r--config/vis/visrc.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/config/vis/visrc.lua b/config/vis/visrc.lua
new file mode 100644
index 0000000..3ac1042
--- /dev/null
+++ b/config/vis/visrc.lua
@@ -0,0 +1,29 @@
+require('vis')
+require('plugins/vis-pairs')
+require('plugins/vis-lspc')
+local format = require('plugins/vis-format')
+format.formatters.caml = format.stdio_formatter("ocamlformat --impl -")
+
+vis:command_register("fd", function(argv, force, cur_win, selection, range)
+ local out = io.popen("fd . | vis-menu"):read()
+ if out then
+ vis:command(string.format('e'..' "%s"', out))
+ vis:feedkeys("<vis-redraw>")
+ end
+end, 'fuzzy file search')
+
+vis.events.subscribe(vis.events.INIT, function()
+ -- Your global configuration options
+ vis:command('set theme minimal-light')
+ vis:map(vis.modes.NORMAL, '=', format.apply)
+ vis:map(vis.modes.NORMAL, ',', ":")
+ vis:map(vis.modes.VISUAL, 'gq', ":|fmt -w 80")
+end)
+
+vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- luacheck: no unused args
+ -- Your per window configuration options e.g.
+ -- vis:command('set number')
+ vis:command('set showeof off')
+ vis:command('set expandtab')
+ vis:command('set tw 2')
+end)