[neovim] Add border and max width to floating windows
This commit is contained in:
parent
a978993d21
commit
69bfb70de8
1 changed files with 21 additions and 0 deletions
|
@ -457,6 +457,27 @@ vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Diagnostic: go to
|
|||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Diagnostic: go to next' })
|
||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, { desc = 'Diagnostic: set loclist' })
|
||||
|
||||
-- Add a border to LSP windows
|
||||
local _border = "single"
|
||||
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
||||
vim.lsp.handlers.hover, {
|
||||
border = _border
|
||||
}
|
||||
)
|
||||
|
||||
-- TODO: Is this necessary? Or is signature help being handled with LSPSaga?
|
||||
--[[
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
|
||||
vim.lsp.handlers.signature_help, {
|
||||
border = _border
|
||||
}
|
||||
)
|
||||
--]]
|
||||
|
||||
vim.diagnostic.config{
|
||||
float = { border = _border, max_width = 120 }
|
||||
}
|
||||
-- Use LspAttach autocommand to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
|
|
Loading…
Reference in a new issue