Arch 2025 rice. Also contains a newly inspired neovim config.
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.

37 lines
928 B

2 weeks ago
  1. return {
  2. 'nvim-telescope/telescope.nvim',
  3. tag = '0.1.x',
  4. dependencies = { 'nvim-lua/plenary.nvim' },
  5. config = function()
  6. local builtin = require("telescope.builtin")
  7. local path = require("plenary.path")
  8. local function git_exists()
  9. local p = "."
  10. while true do
  11. local gitpath = p .. "/.git"
  12. local d = io.open(gitpath)
  13. if d then
  14. d:close()
  15. return true
  16. else
  17. p = p .. "/.."
  18. end
  19. if path:new(p):absolute() == "/" then
  20. return false
  21. end
  22. end
  23. end
  24. vim.keymap.set('n', '<C-P>', function()
  25. if git_exists() then
  26. builtin.git_files()
  27. else
  28. builtin.find_files()
  29. end
  30. end, {})
  31. vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
  32. vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
  33. vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
  34. end
  35. }