summaryrefslogtreecommitdiff
path: root/.config/nvim
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/after/plugin/telescope.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/.config/nvim/after/plugin/telescope.lua b/.config/nvim/after/plugin/telescope.lua
index fa355e1..c7f4937 100644
--- a/.config/nvim/after/plugin/telescope.lua
+++ b/.config/nvim/after/plugin/telescope.lua
@@ -1,9 +1,15 @@
+local os = require('os')
local builtin = require('telescope.builtin')
local lib = require('mango.lib')
---vim.keymap.set('n', '<leader>pf', builtin.git_files, {})
+lib.remap('n', '<leader>pf', function()
+ if os.execute('git rev-parse --is-inside-work-tree') == 0 then
+ builtin.git_files()
+ else
+ builtin.find_files()
+ end
+end)
-lib.remap('n', '<leader>pf', builtin.find_files)
lib.remap('n', '<leader>ps', function()
builtin.grep_string({ search = vim.fn.input('Grep > ') })
end)