lsp_lines added

This commit is contained in:
adollar 2025-06-25 19:59:00 +01:00
parent c47d849a01
commit 1cd81cee70
4 changed files with 44 additions and 20 deletions

View file

@ -76,6 +76,8 @@ require('lazy').setup({
require 'plugins.alpha',
require 'plugins.autotag',
require 'plugins.colorizer',
require 'plugins.fugitive',
require 'plugins.rhubarb',
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
--
@ -255,23 +257,24 @@ require('lazy').setup({
end,
},
-- LSP Plugins
{
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
'folke/lazydev.nvim',
ft = 'lua',
opts = {
library = {
-- Load luvit types when the `vim.uv` word is found
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
},
},
},
{
-- Main LSP Configuration
'neovim/nvim-lspconfig',
dependencies = {
{
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
'folke/lazydev.nvim',
ft = 'lua',
opts = {
library = {
-- Load luvit types when the `vim.uv` word is found
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
},
},
},
-- Automatically install LSPs and related tools to stdpath for Neovim
-- Mason must be loaded before its dependents so we need to set it up here.
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
@ -284,6 +287,7 @@ require('lazy').setup({
-- Allows extra capabilities provided by blink.cmp
'saghen/blink.cmp',
{ 'https://git.sr.ht/~whynothugo/lsp_lines.nvim' },
},
config = function()
-- Brief aside: **What is LSP?**
@ -348,7 +352,7 @@ require('lazy').setup({
-- To jump back, press <C-t>.
map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
-- WARN: This is not Goto Definition, this is Goto Declaration.
-- WARN: This is not Goto De
-- For example, in C this would take you to the header.
map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
@ -477,7 +481,6 @@ require('lazy').setup({
-- But for many setups, the LSP (`ts_ls`) will work just fine
-- ts_ls = {},
--
lua_ls = {
-- cmd = { ... },
-- filetypes = { ... },
@ -488,7 +491,7 @@ require('lazy').setup({
callSnippet = 'Replace',
},
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
-- diagnostics = { disable = { 'missing-fields' } },
-- diagnostics = { disable = { 'missing-fields' } }, },
},
},
},
@ -527,6 +530,18 @@ require('lazy').setup({
end,
},
}
require('lsp_lines').setup()
vim.diagnostic.config { virtual_text = true, virtual_lines = false }
vim.keymap.set('', '<leader>l', function()
local config = vim.diagnostic.config() or {}
if config.virtual_text then
vim.diagnostic.config { virtual_text = false, virtual_lines = true }
else
vim.diagnostic.config { virtual_text = true, virtual_lines = false }
end
end, { desc = 'Toggle lsp_lines' })
end,
},
@ -770,10 +785,7 @@ require('lazy').setup({
--
-- require 'kickstart.plugins.debug',
-- require 'kickstart.plugins.indent_line',
-- require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
require 'kickstart.plugins.lint',
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config.