Add silent option to a lot of keymaps to hide command display.
This commit is contained in:
parent
23ed2e9964
commit
8263b02c70
6 changed files with 26 additions and 7 deletions
|
|
@ -33,7 +33,7 @@ return {
|
|||
},
|
||||
})
|
||||
|
||||
require("utils").add_keymaps({
|
||||
local keymaps = {
|
||||
n = {
|
||||
["<Leader>ci"] = { cmd = "<cmd>CodeCompanion<cr>" },
|
||||
["<Leader>cc"] = { cmd = "<cmd>CodeCompanionChat toggle<cr>" },
|
||||
|
|
@ -46,7 +46,10 @@ return {
|
|||
["<Leader>cf"] = { cmd = "<cmd>CodeCompanion /fix<cr>" },
|
||||
["<Leader>ct"] = { cmd = "<cmd>CodeCompanion /tests<cr>" },
|
||||
}
|
||||
})
|
||||
}
|
||||
local utils = require("utils")
|
||||
utils.add_opts_to_all_mappings(keymaps, { silent = true })
|
||||
utils.add_keymaps(keymaps)
|
||||
|
||||
vim.cmd([[cab cc CodeCompanion]])
|
||||
end
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ return {
|
|||
require("utils").add_keymaps({
|
||||
v = {
|
||||
["<leader>cs"] = {
|
||||
cmd = ":CodeSnap<CR>"
|
||||
cmd = ":CodeSnap<CR>",
|
||||
opts = { silent = true },
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ return {
|
|||
}
|
||||
})
|
||||
|
||||
require("utils").add_keymaps({
|
||||
local keymaps = {
|
||||
n = {
|
||||
["[d"] = {
|
||||
cmd = ":Lspsaga diagnostic_jump_prev<CR>"
|
||||
|
|
@ -58,6 +58,9 @@ return {
|
|||
cmd = ":Lspsaga incoming_calls<CR>"
|
||||
},
|
||||
}
|
||||
})
|
||||
}
|
||||
local utils = require("utils")
|
||||
utils.add_opts_to_all_mappings(keymaps, { silent = true })
|
||||
utils.add_keymaps(keymaps)
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,8 @@ return {
|
|||
keymaps.n["<leader>" .. command.keys] = {
|
||||
cmd = function()
|
||||
toggle_trouble_mode(command.mode)
|
||||
end
|
||||
end,
|
||||
opts = { silent = true }
|
||||
}
|
||||
end
|
||||
utils.add_keymaps(keymaps)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ return {
|
|||
config = function()
|
||||
require("utils").add_keymaps({
|
||||
n = {
|
||||
["<leader>ud"] = { cmd = ":UndotreeToggle<CR>" }
|
||||
["<leader>ud"] = { cmd = ":UndotreeToggle<CR>", opts = { silent = true } }
|
||||
}
|
||||
})
|
||||
end
|
||||
|
|
|
|||
|
|
@ -25,6 +25,17 @@ function M.broadcast_event(event_name)
|
|||
vim.api.nvim_command("doautocmd <nomodeline> User " .. event_name)
|
||||
end
|
||||
|
||||
function M.add_opts_to_all_mappings(mappings, opts)
|
||||
assert(opts and mappings)
|
||||
|
||||
for _, modes in pairs(mappings) do
|
||||
for _, mapping in pairs(modes) do
|
||||
local existing_opts = mapping.opts or {}
|
||||
mapping.opts = vim.tbl_extend("force", existing_opts, opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function M.add_keymaps(maps)
|
||||
assert(maps)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue