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.

74 lines
1.9 KiB

  1. local map = vim.api.nvim_set_keymap
  2. -- == LSP Pickers ==
  3. map('n', '<Leader>ll', "<Cmd> Telescope <CR>", {
  4. noremap = true,
  5. desc = "Open main telescope picket"
  6. })
  7. map('n', '<C-p>', "<Cmd> Telescope commands <CR>", {
  8. noremap = true,
  9. desc = "Open main telescope picket"
  10. })
  11. map('n', '<Leader><Leader>', "<Cmd>lua vim.lsp.buf.code_action()<CR>", {
  12. noremap = true,
  13. desc = "Resume last pick action"
  14. })
  15. map('n', '<Leader>lf', "<Cmd> lua require('telescope.builtin').find_files()<CR>", {
  16. noremap = true,
  17. desc = "Open File"
  18. })
  19. map('n', '<Leader>ld', "<Cmd> lua require('telescope.builtin').lsp_definitions()<CR>", {
  20. noremap = true,
  21. desc = "Go to definition"
  22. })
  23. map('n', '<Leader>lr', "<Cmd> lua require('telescope.builtin').lsp_references()<CR>", {
  24. noremap = true,
  25. desc = "List to references to word under cursor"
  26. })
  27. map('n', '<Leader>lt', "<Cmd>lua require('telescope.builtin').treesitter()<CR>", {
  28. noremap = true,
  29. desc = "List symbols in workspace with treesitter"
  30. })
  31. map('n', '<Leader>lw', "<Cmd>lua require('telescope.builtin').diagnostics()<CR>", {
  32. noremap = true,
  33. desc = "List diagnostic items"
  34. })
  35. map('n', '<Leader>lm', "<Cmd>lua require('telescope.builtin').man_pages()<CR>", {
  36. noremap = true,
  37. desc = "List view manpage"
  38. })
  39. map('n', '<Leader><Space>', "<Cmd>lua vim.lsp.buf.code_action()<CR>", {
  40. noremap = true,
  41. desc = "Pick code action"
  42. })
  43. map("v", "<Leader><Space>", "<Cmd>'<,'>lua vim.lsp.buf.code_action()<CR>", {
  44. noremap = true,
  45. desc = "Pick code action for selection"
  46. })
  47. map('n', '<Leader>ls', "<Cmd>lua require('telescope.builtin').live_grep()<CR>", {
  48. noremap = true,
  49. desc = "Live search"
  50. })
  51. -- == Misc Keybinds ==
  52. map('n', '<Leader>b', "<Cmd>lua require('telescope.builtin').buffers()<CR>", {
  53. noremap = true,
  54. desc = "List and pick buffers"
  55. })
  56. map('n', '<Leader>S', "<Cmd>Telescope persisted<CR>", {
  57. noremap = true,
  58. desc = "Select a persisted session"
  59. })