using find files instead of git_files, find_files respects .gitignore

but looks at the files system, git_files only looks at git tracked files
(issues with git submodules)
This commit is contained in:
Tyler White 2023-05-30 22:26:58 -07:00
parent 759b9a0d73
commit 0469b99f40
1 changed files with 1 additions and 7 deletions

View File

@ -3,17 +3,11 @@ require('buildcmd')
local tbuiltin = require('telescope.builtin')
vim.g.mapleader = ' ' --space
local function project_files()
local opts = {}
local ok = pcall(tbuiltin.git_files, opts)
if not ok then tbuiltin.find_files(opts) end
end
-- Mappings, mostly taken from nvim-lspconfig
local opts = { noremap=true, silent=true }
vim.keymap.set('n', '<leader>q', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '<leader>e', '<cmd>Ex<CR>', opts)
vim.keymap.set('n', '<leader>ff', project_files, opts)
vim.keymap.set('n', '<leader>ff', tbuiltin.find_files, opts)
vim.keymap.set('n', '<leader>fb', '<cmd>Telescope buffers<cr>', opts)
vim.keymap.set('n', '<leader>bb', save_all_and_build, opts)
-- TODO: get fancy and read the commentstring and user