close window on fzf
This commit is contained in:
parent
f28279f9f4
commit
29c28feec0
@ -16,15 +16,27 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win)
|
|||||||
vis:command('set show-tabs on')
|
vis:command('set show-tabs on')
|
||||||
vis:command('set number')
|
vis:command('set number')
|
||||||
vis:command('set theme dark-16')
|
vis:command('set theme dark-16')
|
||||||
vis:command('set escdelay 1')
|
vis:command('set escdelay 0')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
vis:map(vis.modes.NORMAL, ";l", function()
|
vis:command_register("fzf", function(argv, force, cur_win, selection, range)
|
||||||
|
local old = cur_win
|
||||||
local out = io.popen("fzf"):read()
|
local out = io.popen("fzf"):read()
|
||||||
if out then
|
if out then
|
||||||
vis:command(string.format('open %s', out))
|
vis:command(string.format('open %s', out))
|
||||||
|
if argv[1] then
|
||||||
|
old:close(force)
|
||||||
|
end
|
||||||
|
vis:feedkeys("<vis-redraw>")
|
||||||
end
|
end
|
||||||
vis:feedkeys("<vis-redraw>")
|
end)
|
||||||
|
|
||||||
|
vis:map(vis.modes.NORMAL, ";l", function()
|
||||||
|
vis:command('fzf')
|
||||||
|
end)
|
||||||
|
|
||||||
|
vis:map(vis.modes.NORMAL, ";o", function()
|
||||||
|
vis:command('fzf true')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
vis:map(vis.modes.NORMAL, ";;", "<vis-window-next>")
|
vis:map(vis.modes.NORMAL, ";;", "<vis-window-next>")
|
||||||
|
Loading…
Reference in New Issue
Block a user