Neovim configs for 2023. Hopefully they last.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
669 B

local builtin = require("telescope.builtin")
local function git_exists()
local path = require("pl.path")
local p = "."
while true do
local gitpath = p .. "/.git"
local d = io.open(gitpath)
if d then
d:close()
return true
else
p = p .. "/.."
end
if path.abspath(p) ~= "/" then
return false
end
end
end
vim.keymap.set('n', '<C-P>', function()
if git_exists() then
builtin.git_files()
else
builtin.find_files()
end
end, {})
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})