nvim: return of fzy_ignore
Anirudh Oppiliappan x@icyphox.sh
Sat, 15 Jan 2022 15:35:01 +0530
1 files changed,
13 insertions(+),
1 deletions(-)
jump to
M
config/nvim/lua/maps.lua
→
config/nvim/lua/maps.lua
@@ -20,13 +20,25 @@ cmd(':command! Wqa wqa')
cmd(':command! W w') cmd(':command! Q q') +local function fzy_ignore(patterns) + pattern_cmd = {} + for _, p in ipairs(patterns) do + table.insert(pattern_cmd, string.format("! -path '%s'", p)) + end + + return table.concat(pattern_cmd, ' ') +end + -- fzy mappings if vim.fn.executable('fzy') then _G.fzy_edit = require('fzy.edit').fzy_edit map( '', '<leader>e', - ':call v:lua.fzy_edit("git ls-files")<cr>', + string.format( + ':call v:lua.fzy_edit("find -L . -type f %s | cut -c3-")<cr>', + fzy_ignore{'*.git/*', '*node_modules*', '*.pyc', '*migrations*'} + ), { noremap=true, silent=true } )