Another copy of my dotfiles. Because I don't completely trust GitHub.
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.

67 lines
1.8 KiB

1 year ago
  1. local map = vim.api.nvim_set_keymap
  2. local harpoon = require('harpoon')
  3. -- basic telescope configuration
  4. local conf = require("telescope.config").values
  5. local function toggle_telescope(harpoon_files)
  6. local file_paths = {}
  7. for _, item in ipairs(harpoon_files.items) do
  8. table.insert(file_paths, item.value)
  9. end
  10. require("telescope.pickers").new({}, {
  11. prompt_title = "Harpoon",
  12. finder = require("telescope.finders").new_table({
  13. results = file_paths,
  14. }),
  15. previewer = conf.file_previewer({}),
  16. sorter = conf.generic_sorter({}),
  17. }):find()
  18. end
  19. -- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
  20. vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
  21. vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
  22. vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end,
  23. { desc = "Open harpoon window" })
  24. map('n', '<Leader>tt', "<Cmd> NvimTreeToggle<CR>", {
  25. noremap = true,
  26. desc = "Toggle directory tree"
  27. })
  28. map('n', '<Leader>tf', "<Cmd> NvimTreeFindFile<CR>", {
  29. noremap = true,
  30. desc = "Go to current file in dir tree"
  31. })
  32. map('n', '<Leader>ta', "<Cmd> AerialToggle<CR>", {
  33. noremap = true,
  34. desc = "Open aerial sidebar"
  35. })
  36. map('n', '<Leader>tn', "<Cmd> AerialNavToggle<CR>", {
  37. noremap = true,
  38. desc = "Toggle aerial navigator"
  39. })
  40. map('n', '<Leader>Z', "<Cmd> lua require('zen-mode').toggle({})<CR>", {
  41. noremap = true,
  42. desc = "Toggle zen mode"
  43. })
  44. map('n', '<Leader>G', "<Cmd> Neogit<CR>", {
  45. noremap = true,
  46. desc = "Open Neogit"
  47. })
  48. map('n', '<Leader>lz', "<Cmd>DevdocsOpenFloat<CR>", {
  49. noremap = true,
  50. desc = "Open devdocs viewer"
  51. })
  52. vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end,
  53. { desc = "Open harpoon window" })