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:
parent
759b9a0d73
commit
0469b99f40
|
@ -3,17 +3,11 @@ require('buildcmd')
|
||||||
local tbuiltin = require('telescope.builtin')
|
local tbuiltin = require('telescope.builtin')
|
||||||
vim.g.mapleader = ' ' --space
|
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
|
-- Mappings, mostly taken from nvim-lspconfig
|
||||||
local opts = { noremap=true, silent=true }
|
local opts = { noremap=true, silent=true }
|
||||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.open_float, opts)
|
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>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>fb', '<cmd>Telescope buffers<cr>', opts)
|
||||||
vim.keymap.set('n', '<leader>bb', save_all_and_build, opts)
|
vim.keymap.set('n', '<leader>bb', save_all_and_build, opts)
|
||||||
-- TODO: get fancy and read the commentstring and user
|
-- TODO: get fancy and read the commentstring and user
|
||||||
|
|
Loading…
Reference in New Issue