Add lsp_lines with custom toggle keymaps

This commit is contained in:
Tyler Hallada 2023-12-01 15:26:03 -05:00
parent 47296cc673
commit af42913e66
2 changed files with 56 additions and 0 deletions

View File

@ -33,6 +33,7 @@
"indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" },
"keymap-amend.nvim": { "branch": "master", "commit": "b8bf9d820878d5497fdd11d6de55dea82872d98e" },
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
"lsp_lines.nvim": { "branch": "main", "commit": "cf2306dd332e34a3e91075b40bdd4f6db824b2ee" },
"lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "4f81a9213fab94d4c074341acdf7118aaf959275" },
@ -89,6 +90,7 @@
"telescope-undo.nvim": { "branch": "main", "commit": "d3afc1c105535a90caec092ce27a113f77ba7b84" },
"telescope.nvim": { "branch": "master", "commit": "84c5a71d825b6687a55aed6f41e98b92fd8e5454" },
"todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" },
"toggle-lsp-diagnostics.nvim": { "branch": "main", "commit": "4fbfb51e3902d17613be0bc03035ce26b9a8d05d" },
"toggleterm.nvim": { "branch": "main", "commit": "faee9d60428afc7857e0927fdc18daa6c409fa64" },
"tokyonight.nvim": { "branch": "main", "commit": "f247ee700b569ed43f39320413a13ba9b0aef0db" },
"tree-sitter-just": { "branch": "main", "commit": "4e5f5f3ff37b12a1bbf664eb3966b3019e924594" },

54
lua/plugins/lsp-lines.lua Normal file
View File

@ -0,0 +1,54 @@
return {
"neovim/nvim-lspconfig",
dependencies = {
{
"WhoIsSethDaniel/toggle-lsp-diagnostics.nvim",
config = function()
require("toggle_lsp_diagnostics").init({ virtual_text = false })
end,
},
{
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
config = function()
require("lsp_lines").setup()
end,
keys = {
{
"<leader>xv",
function()
require("lsp_lines").toggle()
require("toggle_lsp_diagnostics").toggle_virtual_text()
end,
desc = "Toggle lsp_lines diagnostics",
},
{
"<leader>xy",
function()
if vim.diagnostic.config().virtual_text then
require("toggle_lsp_diagnostics").toggle_virtual_text()
else
require("lsp_lines").toggle()
end
end,
desc = "Toggle diagnostics virtual display",
},
{
"<leader>xz",
function()
if not vim.diagnostic.config().virtual_text then
require("lsp_lines").toggle()
end
require("toggle_lsp_diagnostics").toggle_diagnostics()
end,
desc = "Toggle all diagnostics",
},
},
},
},
opts = {
diagnostics = {
virtual_text = false,
virtual_lines = true,
},
},
}