Split diagnostics config out of completions config
This commit is contained in:
parent
6372e8f63c
commit
a4377b22ac
@ -19,7 +19,6 @@ return {
|
|||||||
-- LSP UI plugins
|
-- LSP UI plugins
|
||||||
'aznhe21/actions-preview.nvim',
|
'aznhe21/actions-preview.nvim',
|
||||||
'j-hui/fidget.nvim',
|
'j-hui/fidget.nvim',
|
||||||
'folke/trouble.nvim',
|
|
||||||
'nvim-tree/nvim-web-devicons',
|
'nvim-tree/nvim-web-devicons',
|
||||||
'ray-x/lsp_signature.nvim',
|
'ray-x/lsp_signature.nvim',
|
||||||
|
|
||||||
@ -146,21 +145,6 @@ return {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
-- Customise diagnostics UI
|
|
||||||
vim.diagnostic.config({
|
|
||||||
float = {
|
|
||||||
border = 'rounded', -- Enable rounded border on floats
|
|
||||||
},
|
|
||||||
virtual_text = false, -- Disable trailing virtual text
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Diagnostics mappings
|
|
||||||
-- TODO: trouble.nvim mappings instead? https://youtu.be/MuUrCcvE-Yw?t=631
|
|
||||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { remap = false })
|
|
||||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { remap = false })
|
|
||||||
vim.keymap.set('n', '<leader>sd', vim.diagnostic.open_float, { remap = false })
|
|
||||||
vim.keymap.set('n', '<leader>sq', vim.diagnostic.setqflist, { remap = false })
|
|
||||||
|
|
||||||
-- Mappings created when LSP is attached to a buffer
|
-- Mappings created when LSP is attached to a buffer
|
||||||
local augroup = vim.api.nvim_create_augroup('lsp', { clear = true })
|
local augroup = vim.api.nvim_create_augroup('lsp', { clear = true })
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
@ -217,10 +201,6 @@ return {
|
|||||||
|
|
||||||
-- LSP UI plugins
|
-- LSP UI plugins
|
||||||
require('fidget').setup({})
|
require('fidget').setup({})
|
||||||
require('trouble').setup({})
|
|
||||||
vim.keymap.set('n', '<leader>tr', function()
|
|
||||||
require('trouble').toggle()
|
|
||||||
end, { remap = false })
|
|
||||||
require('lsp_signature').setup({
|
require('lsp_signature').setup({
|
||||||
floating_window = true,
|
floating_window = true,
|
||||||
hint_enable = false,
|
hint_enable = false,
|
||||||
|
27
lua/plugins/diagnostics.lua
Normal file
27
lua/plugins/diagnostics.lua
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'folke/trouble.nvim',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-tree/nvim-web-devicons'
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require('trouble').setup({})
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>tr', function()
|
||||||
|
require('trouble').toggle()
|
||||||
|
end, { remap = false })
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
float = {
|
||||||
|
border = 'rounded', -- Enable rounded border on floats
|
||||||
|
},
|
||||||
|
virtual_text = false, -- Disable trailing virtual text
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { remap = false })
|
||||||
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { remap = false })
|
||||||
|
vim.keymap.set('n', '<leader>sd', vim.diagnostic.open_float, { remap = false })
|
||||||
|
vim.keymap.set('n', '<leader>sq', vim.diagnostic.setqflist, { remap = false })
|
||||||
|
end
|
||||||
|
},
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user