From 228171561f334595f748816ef37aa76b5370f526 Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Wed, 1 Jun 2022 11:47:00 +0200 Subject: [PATCH] use find files if there is not git repo --- lua/setup/my_command_center.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/setup/my_command_center.lua b/lua/setup/my_command_center.lua index 3d18c97..1b64568 100644 --- a/lua/setup/my_command_center.lua +++ b/lua/setup/my_command_center.lua @@ -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 = 'Telescope git_files', + cmd = 'lua project_files()', keybindings = { { 'n', 'g', silent_noremap }, },