From c8808544dede1e3e0b3d15c15f136fe6a096cdcb Mon Sep 17 00:00:00 2001 From: Mystical-C <64483945+MysticalDevil@users.noreply.github.com> Date: Sun, 29 Oct 2023 08:12:31 +0800 Subject: [PATCH] fix: Adjust legendary.nvim configs, mv some keymaps to which-key config --- lua/devil/configs/plugin/legendary.lua | 6 +++--- lua/devil/configs/plugin/lspsaga.lua | 2 -- lua/devil/configs/plugin/which-key.lua | 5 ++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lua/devil/configs/plugin/legendary.lua b/lua/devil/configs/plugin/legendary.lua index 8e39488..362280e 100644 --- a/lua/devil/configs/plugin/legendary.lua +++ b/lua/devil/configs/plugin/legendary.lua @@ -34,7 +34,7 @@ local opts = { -- of each individual item default_opts = { -- for example, { silent = true, remap = false } - keymaps = {}, + keymaps = { silent = true, remap = true }, -- for example, { args = '?', bang = true } commands = {}, -- for example, { buf = 0, once = true } @@ -115,7 +115,7 @@ local opts = { lazy_nvim = { -- Automatically register keymaps that are defined on lazy.nvim plugin specs -- using the `keys = {}` property. - auto_register = false, + auto_register = true, }, -- Which extensions to load; no extensions are loaded by default. -- Setting the plugin name to `false` disables loading the extension. @@ -144,7 +144,7 @@ local opts = { which_key = { -- Automatically add which-key tables to legendary -- see ./doc/WHICH_KEY.md for more details - auto_register = false, + auto_register = true, -- you can put which-key.nvim tables here, -- or alternatively have them auto-register, -- see ./doc/WHICH_KEY.md diff --git a/lua/devil/configs/plugin/lspsaga.lua b/lua/devil/configs/plugin/lspsaga.lua index 2c68192..5b04c7f 100644 --- a/lua/devil/configs/plugin/lspsaga.lua +++ b/lua/devil/configs/plugin/lspsaga.lua @@ -186,5 +186,3 @@ local opts = { } lspsaga.setup(opts) - -require("devil.utils").keymap("n", "", "Lspsaga term_toggle", { desc = "Float term" }) diff --git a/lua/devil/configs/plugin/which-key.lua b/lua/devil/configs/plugin/which-key.lua index 9089d8b..36748cb 100644 --- a/lua/devil/configs/plugin/which-key.lua +++ b/lua/devil/configs/plugin/which-key.lua @@ -81,9 +81,8 @@ local opts = { which_key.setup(opts) -local utils = require("devil.utils") - which_key.register({ + [""] = { "Lspsaga term_toggle", desc = "Float term" }, ["q"] = { "q", "Quit editor" }, ["f"] = { function() @@ -137,7 +136,7 @@ which_key.register({ l = { "TroubleToggle loclist", "Open trouble loclist" }, r = { "TroubleToggle lsp_references", "Open LSP references" }, }, - s = { + p = { name = "+plugins", s = { "RestNvim", "Run request under cursor" }, p = { "RestNvimPreview", "Preview request cURL command" },