config.lua 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. mappings = {
  40. ["w"] = "Save",
  41. ["q"] = "Quit",
  42. ["."] = "LunarConfig",
  43. ["/"] = "Comment",
  44. ["c"] = "Close Buffer",
  45. ["e"] = "Explorer",
  46. ["f"] = "Find File",
  47. ["h"] = "No Highlight",
  48. [";"] = "Dashboard",
  49. p = {
  50. name = "Packer",
  51. c = { "<cmd>PackerCompile<cr>", "Compile" },
  52. i = { "<cmd>PackerInstall<cr>", "Install" },
  53. r = { "<cmd>lua require('lv-utils').reload_lv_config()<cr>", "Reload" },
  54. s = { "<cmd>PackerSync<cr>", "Sync" },
  55. u = { "<cmd>PackerUpdate<cr>", "Update" },
  56. },
  57. -- " Available Debug Adapters:
  58. -- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/
  59. -- " Adapter configuration and installation instructions:
  60. -- " https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation
  61. -- " Debug Adapter protocol:
  62. -- " https://microsoft.github.io/debug-adapter-protocol/
  63. -- " Debugging
  64. g = {
  65. name = "Git",
  66. j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
  67. k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
  68. l = { "<cmd>lua require 'gitsigns'.blame_line()<cr>", "Blame" },
  69. p = { "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk" },
  70. r = { "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk" },
  71. R = { "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", "Reset Buffer" },
  72. s = { "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", "Stage Hunk" },
  73. u = {
  74. "<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>",
  75. "Undo Stage Hunk",
  76. },
  77. o = { "<cmd>Telescope git_status<cr>", "Open changed file" },
  78. b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
  79. c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" },
  80. C = {
  81. "<cmd>Telescope git_bcommits<cr>",
  82. "Checkout commit(for current file)",
  83. },
  84. },
  85. l = {
  86. name = "LSP",
  87. a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Code Action" },
  88. d = {
  89. "<cmd>Telescope lsp_document_diagnostics<cr>",
  90. "Document Diagnostics",
  91. },
  92. w = {
  93. "<cmd>Telescope lsp_workspace_diagnostics<cr>",
  94. "Workspace Diagnostics",
  95. },
  96. f = { "<cmd>Neoformat<cr>", "Format" },
  97. i = { "<cmd>LspInfo<cr>", "Info" },
  98. j = { "<cmd>lua vim.lsp.diagnostic.goto_next({popup_opts = {border = O.lsp.popup_border}})<cr>", "Next Diagnostic" },
  99. k = { "<cmd>lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})<cr>", "Prev Diagnostic" },
  100. q = { "<cmd>Telescope quickfix<cr>", "Quickfix" },
  101. r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
  102. s = { "<cmd> Telescope lsp_document_symbols<cr>", "Document Symbols" },
  103. S = {
  104. "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>",
  105. "Workspace Symbols",
  106. },
  107. },
  108. s = {
  109. name = "Search",
  110. b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
  111. c = { "<cmd>Telescope colorscheme<cr>", "Colorscheme" },
  112. f = { "<cmd>Telescope find_files<cr>", "Find File" },
  113. h = { "<cmd>Telescope help_tags<cr>", "Find Help" },
  114. M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
  115. r = { "<cmd>Telescope oldfiles<cr>", "Open Recent File" },
  116. R = { "<cmd>Telescope registers<cr>", "Registers" },
  117. t = { "<cmd>Telescope live_grep<cr>", "Text" },
  118. },
  119. T = {
  120. name = "Treesitter",
  121. i = { ":TSConfigInfo<cr>", "Info" },
  122. },
  123. },
  124. }