better diagnostics
This commit is contained in:
@@ -57,6 +57,10 @@ lsp.on_attach(function(_, bufnr)
|
||||
vim.keymap.set('n', 'gT', '<Cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
vim.keymap.set('n', 'gR', '<Cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
|
||||
-- diagnostics
|
||||
vim.keymap.set('n', 'gn', '<Cmd>lua vim.diagnostic.goto_next()<CR>', opts)
|
||||
vim.keymap.set('n', 'gp', '<Cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
|
||||
|
||||
-- action & rename
|
||||
vim.keymap.set('n', '<A-CR>', '<Cmd>Lspsaga code_action<CR>', opts)
|
||||
vim.keymap.set('n', '<Leader>gr', '<Cmd>Lspsaga rename<CR>', opts)
|
||||
|
||||
@@ -84,7 +84,7 @@ local packer = require('packer').startup(function(use)
|
||||
end
|
||||
}
|
||||
|
||||
-- zen mode
|
||||
-- zen m
|
||||
use {
|
||||
'folke/zen-mode.nvim',
|
||||
config = function()
|
||||
@@ -105,15 +105,7 @@ local packer = require('packer').startup(function(use)
|
||||
-- nerd commenter
|
||||
use 'scrooloose/nerdcommenter'
|
||||
|
||||
-- nice diagnostic pane on the bottom
|
||||
use {
|
||||
'folke/trouble.nvim',
|
||||
config = function ()
|
||||
require('plugin-config/lsp-trouble')
|
||||
end
|
||||
}
|
||||
|
||||
-- vscode like LSP code previews
|
||||
-- LSP code previews
|
||||
use {
|
||||
"glepnir/lspsaga.nvim",
|
||||
opt = true,
|
||||
@@ -255,6 +247,25 @@ local packer = require('packer').startup(function(use)
|
||||
end
|
||||
}
|
||||
|
||||
use({
|
||||
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
|
||||
config = function()
|
||||
require("lsp_lines").setup()
|
||||
vim.keymap.set("", "<leader>x", function()
|
||||
local config = vim.diagnostic.config()
|
||||
vim.diagnostic.config({
|
||||
virtual_text = not config.virtual_text,
|
||||
virtual_lines = not config.virtual_lines,
|
||||
})
|
||||
end, { desc = "Toggle Line Diagnostics" })
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
virtual_lines = false,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
-- this will automatically install listed dependencies
|
||||
-- only the first time NeoVim is opened, because that's when Packer gets installed
|
||||
if packerBootstrap then
|
||||
|
||||
Reference in New Issue
Block a user