diff options
| author | Julian Berman <Julian@GrayVines.com> | 2020-12-26 12:48:49 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-26 18:48:49 +0100 |
| commit | 20fffc7c250f8488342566162a045d6a0ba1cd37 (patch) | |
| tree | 32a3310c1b281d64b1f245254c5f965059cc84ee /lua | |
| parent | 049602a2c5f436fd7758fe5dd2fd1fcea696b83b (diff) | |
Feat: Add hidden to find_files (#340)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/builtin/files.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lua/telescope/builtin/files.lua b/lua/telescope/builtin/files.lua index 1597bc9..7051305 100644 --- a/lua/telescope/builtin/files.lua +++ b/lua/telescope/builtin/files.lua @@ -57,6 +57,7 @@ end -- Support `find` and maybe let people do other stuff with it as well. files.find_files = function(opts) local find_command = opts.find_command + local hidden = opts.hidden local search_dirs = opts.search_dirs if search_dirs then @@ -68,6 +69,7 @@ files.find_files = function(opts) if not find_command then if 1 == vim.fn.executable("fd") then find_command = { 'fd', '--type', 'f' } + if hidden then table.insert(find_command, '--hidden') end if search_dirs then table.insert(find_command, '.') for _,v in pairs(search_dirs) do @@ -76,6 +78,7 @@ files.find_files = function(opts) end elseif 1 == vim.fn.executable("fdfind") then find_command = { 'fdfind', '--type', 'f' } + if hidden then table.insert(find_command, '--hidden') end if search_dirs then table.insert(find_command, '.') for _,v in pairs(search_dirs) do @@ -84,6 +87,7 @@ files.find_files = function(opts) end elseif 1 == vim.fn.executable("rg") then find_command = { 'rg', '--files' } + if hidden then table.insert(find_command, '--hidden') end if search_dirs then for _,v in pairs(search_dirs) do table.insert(find_command, v) @@ -91,6 +95,7 @@ files.find_files = function(opts) end elseif 1 == vim.fn.executable("find") then find_command = { 'find', '.', '-type', 'f' } + if not hidden then vim.tbl_extend("error", find_command, {'-not', '-path', '*/.*'}) end if search_dirs then table.remove(find_command, 2) for _,v in pairs(search_dirs) do |
