use find files if there is not git repo

This commit is contained in:
Oliver Hartmann 2022-06-01 11:47:00 +02:00
parent b1754cf7db
commit 228171561f

View File

@ -4,6 +4,12 @@ local command_center = require('command_center')
local noremap = { noremap = true }
local silent_noremap = { noremap = true, silent = true }
project_files = function()
local opts = {} -- define here if you want to define something
local ok = pcall(require"telescope.builtin".git_files, opts)
if not ok then require"telescope.builtin".find_files(opts) end
end
command_center.add({
{
description = 'Open command_center',
@ -84,7 +90,7 @@ command_center.add({
},
{
description = 'Find git files',
cmd = '<CMD>Telescope git_files<CR>',
cmd = '<CMD>lua project_files()<CR>',
keybindings = {
{ 'n', '<leader>g', silent_noremap },
},