From ffa3466d3451022b19c6a5a73d7dfc458d66f7b6 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Wed, 29 Nov 2017 17:29:06 +0100 Subject: [PATCH] separate split --- config/vis/visrc.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/config/vis/visrc.lua b/config/vis/visrc.lua index 70ba033..20d929b 100644 --- a/config/vis/visrc.lua +++ b/config/vis/visrc.lua @@ -8,8 +8,7 @@ vis.events.subscribe(vis.events.INIT, function() end) vis.events.subscribe(vis.events.WIN_OPEN, function(win) - -- Your per window configuration options e.g. - -- vis:command('set number') + -- Your per window configuration options vis:command('set tabwidth 4') vis:command('set autoindent on') vis:command('set expandtab on') @@ -20,12 +19,15 @@ vis.events.subscribe(vis.events.WIN_OPEN, function(win) end) 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 " .. table.concat(argv, " ")):read() if out then - vis:command(string.format('open %s', out)) 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 vis:feedkeys("") end