all repos — dotfiles @ ea333c82d09f370b1a0a8e9a1f87e9570571043f

my *nix dotfiles

nvim/lua/fuzzy/edit.lua (view raw)

 1local fn = vim.fn
 2local cmd = vim.cmd
 3local M = {}
 4
 5function M.fuzzy_edit(fuzzy_cmd)
 6  fuzzy_cmd = {
 7    ls_cmd,
 8    '| zf',
 9  }
10
11  require('fuzzy/fuzzy').fuzzy_search(table.concat(fuzzy_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