2023-01-03 14:59:56 +00:00
|
|
|
local M = {}
|
|
|
|
|
2023-08-25 22:13:35 +00:00
|
|
|
local is_inside_work_tree = {}
|
|
|
|
|
2023-01-03 14:59:56 +00:00
|
|
|
M.project_files = function()
|
|
|
|
local opts = {}
|
2023-08-25 22:13:35 +00:00
|
|
|
|
|
|
|
local cwd = vim.fn.getcwd()
|
|
|
|
if is_inside_work_tree[cwd] == nil then
|
|
|
|
vim.fn.system("git rev-parse --is-inside-work-tree")
|
|
|
|
is_inside_work_tree[cwd] = vim.v.shell_error == 0
|
|
|
|
end
|
|
|
|
|
|
|
|
if is_inside_work_tree[cwd] then
|
2023-04-07 16:24:48 +00:00
|
|
|
require("telescope.builtin").git_files({show_untracked=true})
|
2023-01-03 14:59:56 +00:00
|
|
|
else
|
2023-08-25 22:13:35 +00:00
|
|
|
require("telescope.builtin").find_files({hidden=true})
|
2023-01-03 14:59:56 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return M
|