config.lua 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. O.plugin.which_key = {
  2. active = false,
  3. setup = {
  4. plugins = {
  5. marks = true, -- shows a list of your marks on ' and `
  6. registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
  7. -- the presets plugin, adds help for a bunch of default keybindings in Neovim
  8. -- No actual key bindings are created
  9. presets = {
  10. operators = false, -- adds help for operators like d, y, ...
  11. motions = false, -- adds help for motions
  12. text_objects = false, -- help for text objects triggered after entering an operator
  13. windows = true, -- default bindings on <c-w>
  14. nav = true, -- misc bindings to work with windows
  15. z = true, -- bindings for folds, spelling and others prefixed with z
  16. g = true, -- bindings for prefixed with g
  17. },
  18. spelling = { enabled = true, suggestions = 20 }, -- use which-key for spelling hints
  19. },
  20. icons = {
  21. breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
  22. separator = "➜", -- symbol used between a key and it's label
  23. group = "+", -- symbol prepended to a group
  24. },
  25. window = {
  26. border = "single", -- none, single, double, shadow
  27. position = "bottom", -- bottom, top
  28. margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
  29. padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
  30. },
  31. layout = {
  32. height = { min = 4, max = 25 }, -- min and max height of the columns
  33. width = { min = 20, max = 50 }, -- min and max width of the columns
  34. spacing = 3, -- spacing between columns
  35. },
  36. hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
  37. show_help = true, -- show help message on the command line when the popup is visible
  38. },
  39. opts = {
  40. mode = "n", -- NORMAL mode
  41. prefix = "<leader>",
  42. buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
  43. silent = true, -- use `silent` when creating keymaps
  44. noremap = true, -- use `noremap` when creating keymaps
  45. nowait = true, -- use `nowait` when creating keymaps
  46. },
  47. mappings = {
  48. ["w"] = "Save",
  49. ["q"] = "Quit",
  50. ["."] = "LunarConfig",
  51. ["/"] = "Comment",
  52. ["c"] = "Close Buffer",
  53. ["e"] = "Explorer",
  54. ["f"] = "Find File",
  55. ["h"] = "No Highlight",
  56. [";"] = "Dashboard",
  57. p = {
  58. name = "Packer",
  59. c = { "<cmd>PackerCompile<cr>", "Compile" },
  60. i = { "<cmd>PackerInstall<cr>", "Install" },
  61. r = { "<cmd>lua require('lv-utils').reload_lv_config()<cr>", "Reload" },
  62. s = { "<cmd>PackerSync<cr>", "Sync" },
  63. u = { "<cmd>PackerUpdate<cr>", "Update" },
  64. },
  65. -- " Available Debug Adapters:
  66. -- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/
  67. -- " Adapter configuration and installation instructions:
  68. -- " https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation
  69. -- " Debug Adapter protocol:
  70. -- " https://microsoft.github.io/debug-adapter-protocol/
  71. -- " Debugging
  72. g = {
  73. name = "Git",
  74. j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
  75. k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
  76. l = { "<cmd>lua require 'gitsigns'.blame_line()<cr>", "Blame" },
  77. p = { "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk" },
  78. r = { "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk" },
  79. R = { "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", "Reset Buffer" },
  80. s = { "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", "Stage Hunk" },
  81. u = {
  82. "<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>",
  83. "Undo Stage Hunk",
  84. },
  85. o = { "<cmd>Telescope git_status<cr>", "Open changed file" },
  86. b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
  87. c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" },
  88. C = {
  89. "<cmd>Telescope git_bcommits<cr>",
  90. "Checkout commit(for current file)",
  91. },
  92. },
  93. l = {
  94. name = "LSP",
  95. a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Code Action" },
  96. d = {
  97. "<cmd>Telescope lsp_document_diagnostics<cr>",
  98. "Document Diagnostics",
  99. },
  100. w = {
  101. "<cmd>Telescope lsp_workspace_diagnostics<cr>",
  102. "Workspace Diagnostics",
  103. },
  104. f = { "<cmd>Neoformat<cr>", "Format" },
  105. i = { "<cmd>LspInfo<cr>", "Info" },
  106. j = { "<cmd>lua vim.lsp.diagnostic.goto_next({popup_opts = {border = O.lsp.popup_border}})<cr>", "Next Diagnostic" },
  107. k = { "<cmd>lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})<cr>", "Prev Diagnostic" },
  108. q = { "<cmd>Telescope quickfix<cr>", "Quickfix" },
  109. r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
  110. s = { "<cmd> Telescope lsp_document_symbols<cr>", "Document Symbols" },
  111. S = {
  112. "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>",
  113. "Workspace Symbols",
  114. },
  115. },
  116. s = {
  117. name = "Search",
  118. b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
  119. c = { "<cmd>Telescope colorscheme<cr>", "Colorscheme" },
  120. f = { "<cmd>Telescope find_files<cr>", "Find File" },
  121. h = { "<cmd>Telescope help_tags<cr>", "Find Help" },
  122. M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
  123. r = { "<cmd>Telescope oldfiles<cr>", "Open Recent File" },
  124. R = { "<cmd>Telescope registers<cr>", "Registers" },
  125. t = { "<cmd>Telescope live_grep<cr>", "Text" },
  126. },
  127. T = {
  128. name = "Treesitter",
  129. i = { ":TSConfigInfo<cr>", "Info" },
  130. },
  131. },
  132. }