separate split

This commit is contained in:
Felix Van der Jeugt 2017-11-29 17:29:06 +01:00
parent 274b6f62bf
commit ffa3466d34
No known key found for this signature in database
GPG Key ID: 58B209295023754D

View File

@ -8,8 +8,7 @@ vis.events.subscribe(vis.events.INIT, function()
end) end)
vis.events.subscribe(vis.events.WIN_OPEN, function(win) vis.events.subscribe(vis.events.WIN_OPEN, function(win)
-- Your per window configuration options e.g. -- Your per window configuration options
-- vis:command('set number')
vis:command('set tabwidth 4') vis:command('set tabwidth 4')
vis:command('set autoindent on') vis:command('set autoindent on')
vis:command('set expandtab on') vis:command('set expandtab on')
@ -20,12 +19,15 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win)
end) end)
vis:command_register("fzf", function(argv, force, cur_win, selection, range) 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()
--local out = io.popen("fzf " .. table.concat(argv, " ")):read()
if out then if out then
vis:command(string.format('open %s', out))
if argv[1] then if argv[1] then
old:close(force) vis:command(string.format('e %s', out))
-- or vis:command(string.format('open %s', out))
-- should e return false when failed
else
vis:command(string.format('open %s', out))
end end
vis:feedkeys("<vis-redraw>") vis:feedkeys("<vis-redraw>")
end end