AutoYADM commit: 2024-12-05 19:30:02
This commit is contained in:
parent
3832052955
commit
62228bfda1
1 changed files with 25 additions and 22 deletions
|
@ -51,28 +51,31 @@ map({ "n" }, "<S-l>", "H", { remap = false })
|
||||||
-- Duplicate and comment line
|
-- Duplicate and comment line
|
||||||
map({ "n" }, "<leader>yc", '"zyygcc"zp', { remap = true, silent = true, desc = "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 function is_lsp_attached()
|
||||||
local clients = vim.lsp.get_clients({ bufnr = 0 })
|
-- local clients = vim.lsp.get_clients({ bufnr = 0 })
|
||||||
return #clients > 0
|
-- print(#clients .. " clients found")
|
||||||
end
|
-- return #clients > 0
|
||||||
|
-- end
|
||||||
local cptoggle = Snacks.toggle.new({
|
--
|
||||||
name = "Lsp",
|
-- local lsptoggle = Snacks.toggle.new({
|
||||||
-- map = vim.keymap.set,
|
-- name = "Lsp",
|
||||||
which_key = true,
|
-- -- map = vim.keymap.set,
|
||||||
get = function()
|
-- which_key = true,
|
||||||
return not is_lsp_attached()
|
-- get = function()
|
||||||
end,
|
-- return not is_lsp_attached()
|
||||||
notify = true,
|
-- end,
|
||||||
set = function(state)
|
-- notify = true,
|
||||||
if state then
|
-- set = function(state)
|
||||||
vim.cmd("LspStart")
|
-- if state then
|
||||||
else
|
-- -- vim.cmd("LspStart")
|
||||||
vim.cmd("LspStop")
|
-- print("we start lsp...")
|
||||||
end
|
-- else
|
||||||
end,
|
-- -- vim.cmd("LspStop")
|
||||||
})
|
-- print("We stop lsp...")
|
||||||
Snacks.toggle.map(cptoggle, "<leader>at", { desc = "Toggle Copilot" })
|
-- end
|
||||||
|
-- end,
|
||||||
|
-- })
|
||||||
|
-- Snacks.toggle.map(lsptoggle, "<leader>cL", { desc = "Toggle LSP" })
|
||||||
|
|
||||||
-- better quit
|
-- better quit
|
||||||
map("n", "<C-q>", "<cmd>qa<cr>", { desc = "Quit All" })
|
map("n", "<C-q>", "<cmd>qa<cr>", { desc = "Quit All" })
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue