AutoYADM commit: 2024-12-05 19:15:01
This commit is contained in:
parent
1485e825f5
commit
3832052955
1 changed files with 23 additions and 0 deletions
|
@ -51,6 +51,29 @@ map({ "n" }, "<S-l>", "H", { remap = false })
|
|||
-- Duplicate and comment line
|
||||
map({ "n" }, "<leader>yc", '"zyygcc"zp', { remap = true, silent = true, desc = "Duplicate and comment line" })
|
||||
|
||||
local function is_lsp_attached()
|
||||
local clients = vim.lsp.get_clients({ bufnr = 0 })
|
||||
return #clients > 0
|
||||
end
|
||||
|
||||
local cptoggle = Snacks.toggle.new({
|
||||
name = "Lsp",
|
||||
-- map = vim.keymap.set,
|
||||
which_key = true,
|
||||
get = function()
|
||||
return not is_lsp_attached()
|
||||
end,
|
||||
notify = true,
|
||||
set = function(state)
|
||||
if state then
|
||||
vim.cmd("LspStart")
|
||||
else
|
||||
vim.cmd("LspStop")
|
||||
end
|
||||
end,
|
||||
})
|
||||
Snacks.toggle.map(cptoggle, "<leader>at", { desc = "Toggle Copilot" })
|
||||
|
||||
-- better quit
|
||||
map("n", "<C-q>", "<cmd>qa<cr>", { desc = "Quit All" })
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue