all repos — dotfiles @ 5418f7aef0eee82c89c0b7d99a4f38837548b907

my *nix dotfiles

config/nvim/lua/fzy/edit.lua (view raw)

 1local fn = vim.fn
 2local cmd = vim.cmd
 3local M = {}
 4
 5function M.fzy_edit(ls_cmd)
 6  fzy_cmd = {
 7    ls_cmd,
 8    '| zf',
 9  }
10
11  require('fzy/fzy').fzy_search(table.concat(fzy_cmd), function(stdout)
12    -- strip '\n'
13    local selected, _ = stdout:gsub('\n', '')
14    cmd('bd!')
15    cmd('e ' .. selected)
16  end
17  )
18end
19
20return M