commit 4a8c2d1941501b6188bb75c2c796fc48508d368d
parent cc3c609b58c946700d8aeead302be0682f8ecfab
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Mon, 17 Jun 2019 09:51:01 +0200
Fix syntax checking and interpreter calls
Diffstat:
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/.config/vis/visrc.lua b/.config/vis/visrc.lua
@@ -32,27 +32,15 @@ vis:command_register("rg", function(argv, force, cur_win, selection, range)
end, 'fuzzy file-content search')
interpreters = {
- ["python"] = "!python -i $vis_filepath",
- ["lua"] = "!lua -i $vis_filepath",
- ["julia"] = "!julia -i $vis_filepath",
- ["latex"] = "!tmux new-window -a 'latexmk -pdf -pvc -f $vis_filepath'",
+ ['python'] = '!ipython --no-banner -i "$vis_filepath"',
+ ['lua'] = '!lua -i $vis_filepath',
+ ['julia'] = '!julia -i $vis_filepath',
+ ['latex'] = '!tmux new-window -a "latexmk -pdf -pvc -f $vis_filepath"',
}
-vis:command_register("shell", function(argv, force, cur_win, selection, range)
- local out = io.popen("irg"):read()
- if out then
- if argv[1] then
- vis:command(string.format('e "%s"', out))
- else
- vis:command(string.format('open "%s"', out))
- end
- vis:feedkeys("<vis-redraw>")
- end
-end, 'run argv in shell, ignore return status with ')
-
checkers = {
- ["latex"] = "!tmux split-window -p 25 'shellcheck --color=never $vis_filepath | less'",
- ["bash"] = "!tmux split-window -p 25 'shellcheck --color=never $vis_filepath | less'",
+ ['latex'] = '!tmux split-window -p 25 "shellcheck --color=never $vis_filepath | less"',
+ ['bash'] = '!tmux split-window -p 25 "shellcheck --color=never $vis_filepath | less"',
}
vis:command_register("prev", function(argv, force, cur_win, selection, range)
@@ -115,8 +103,6 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win)
function()
local command = checkers[vis.win.syntax]
if command then
- --vis:command(":new")
- --vis:command("<" .. command)
vis:command(command)
end
return true;