summaryrefslogtreecommitdiff
path: root/config/vis/visrc.lua
blob: 3ac1042346680cddaac5523b61973ea22905543e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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)