whick-key.lua 944 B

12345678910111213141516171819202122232425262728293031
  1. -- 快捷键提示
  2. return {
  3. "folke/which-key.nvim",
  4. event = "VeryLazy",
  5. opts = {
  6. plugins = { spelling = true },
  7. defaults = {
  8. mode = { "n", "v" },
  9. ["g"] = { name = "+goto" },
  10. ["gs"] = { name = "+surround" },
  11. ["]"] = { name = "+next" },
  12. ["["] = { name = "+prev" },
  13. ["<leader><tab>"] = { name = "+tabs" },
  14. ["<leader>b"] = { name = "+buffer" },
  15. ["<leader>c"] = { name = "+code" },
  16. ["<leader>f"] = { name = "+file/find" },
  17. ["<leader>g"] = { name = "+git" },
  18. ["<leader>gh"] = { name = "+hunks" },
  19. ["<leader>q"] = { name = "+quit/session" },
  20. ["<leader>s"] = { name = "+search" },
  21. ["<leader>u"] = { name = "+ui" },
  22. ["<leader>w"] = { name = "+windows" },
  23. ["<leader>x"] = { name = "+diagnostics/quickfix" },
  24. },
  25. },
  26. config = function(_, opts)
  27. local wk = require("which-key")
  28. wk.setup(opts)
  29. wk.register(opts.defaults)
  30. end,
  31. }