diff options
author | Anirudh Oppiliappan <x@icyphox.sh> | 2022-01-15 15:35:01 +0530 |
---|---|---|
committer | Anirudh Oppiliappan <x@icyphox.sh> | 2022-01-15 15:35:01 +0530 |
commit | d41acc1737de46361a9fc8b8cb79e541189d736f (patch) | |
tree | d70c47f00887e0e0686ad592e962ff10a225aa4b | |
parent | 4957a235fb16f0929806a5a9978f3d7029a1ce5d (diff) | |
download | dotfiles-d41acc1737de46361a9fc8b8cb79e541189d736f.tar.gz |
nvim: return of fzy_ignore
-rw-r--r-- | config/nvim/lua/maps.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/config/nvim/lua/maps.lua b/config/nvim/lua/maps.lua index 2f641be..6ae251f 100644 --- a/config/nvim/lua/maps.lua +++ b/config/nvim/lua/maps.lua | |||
@@ -20,13 +20,25 @@ cmd(':command! Wqa wqa') | |||
20 | cmd(':command! W w') | 20 | cmd(':command! W w') |
21 | cmd(':command! Q q') | 21 | cmd(':command! Q q') |
22 | 22 | ||
23 | local function fzy_ignore(patterns) | ||
24 | pattern_cmd = {} | ||
25 | for _, p in ipairs(patterns) do | ||
26 | table.insert(pattern_cmd, string.format("! -path '%s'", p)) | ||
27 | end | ||
28 | |||
29 | return table.concat(pattern_cmd, ' ') | ||
30 | end | ||
31 | |||
23 | -- fzy mappings | 32 | -- fzy mappings |
24 | if vim.fn.executable('fzy') then | 33 | if vim.fn.executable('fzy') then |
25 | _G.fzy_edit = require('fzy.edit').fzy_edit | 34 | _G.fzy_edit = require('fzy.edit').fzy_edit |
26 | map( | 35 | map( |
27 | '', | 36 | '', |
28 | '<leader>e', | 37 | '<leader>e', |
29 | ':call v:lua.fzy_edit("git ls-files")<cr>', | 38 | string.format( |
39 | ':call v:lua.fzy_edit("find -L . -type f %s | cut -c3-")<cr>', | ||
40 | fzy_ignore{'*.git/*', '*node_modules*', '*.pyc', '*migrations*'} | ||
41 | ), | ||
30 | { noremap=true, silent=true } | 42 | { noremap=true, silent=true } |
31 | ) | 43 | ) |
32 | 44 | ||