use find files if there is not git repo
This commit is contained in:
parent
b1754cf7db
commit
228171561f
@ -4,6 +4,12 @@ local command_center = require('command_center')
|
|||||||
local noremap = { noremap = true }
|
local noremap = { noremap = true }
|
||||||
local silent_noremap = { noremap = true, silent = 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({
|
command_center.add({
|
||||||
{
|
{
|
||||||
description = 'Open command_center',
|
description = 'Open command_center',
|
||||||
@ -84,7 +90,7 @@ command_center.add({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
description = 'Find git files',
|
description = 'Find git files',
|
||||||
cmd = '<CMD>Telescope git_files<CR>',
|
cmd = '<CMD>lua project_files()<CR>',
|
||||||
keybindings = {
|
keybindings = {
|
||||||
{ 'n', '<leader>g', silent_noremap },
|
{ 'n', '<leader>g', silent_noremap },
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user