mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-07-31 08:04:53 +02:00
Add borders to lsp popups (#686)
* feat(lsp): add single type border to hover popup * feat(lsp): add single type border to signatureHelp * feat(lsp): add border to line diagnostic popup * feat(lsp): use global option to configure borders
This commit is contained in:
parent
018343d44a
commit
5eed5cf3ec
3 changed files with 20 additions and 4 deletions
|
@ -31,6 +31,10 @@ O = {
|
|||
rainbow = { enabled = false },
|
||||
},
|
||||
|
||||
lsp = {
|
||||
popup_border = "single"
|
||||
},
|
||||
|
||||
database = { save_location = "~/.config/nvcode_db", auto_execute = 1 },
|
||||
|
||||
plugin = {
|
||||
|
|
|
@ -22,8 +22,8 @@ vim.cmd("nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>")
|
|||
vim.cmd("nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>")
|
||||
vim.cmd("nnoremap <silent> K :lua vim.lsp.buf.hover()<CR>")
|
||||
-- vim.cmd('nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>')
|
||||
vim.cmd("nnoremap <silent> <C-p> :lua vim.lsp.diagnostic.goto_prev()<CR>")
|
||||
vim.cmd("nnoremap <silent> <C-n> :lua vim.lsp.diagnostic.goto_next()<CR>")
|
||||
vim.cmd("nnoremap <silent> <C-p> :lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})<CR>")
|
||||
vim.cmd("nnoremap <silent> <C-n> :lua vim.lsp.diagnostic.goto_next({popup_opts = {border = O.lsp.popup_border}})<CR>")
|
||||
-- scroll down hover doc or scroll in definition preview
|
||||
-- scroll up hover doc
|
||||
vim.cmd('command! -nargs=0 LspVirtualTextToggle lua require("lsp/virtual_text").toggle()')
|
||||
|
@ -41,6 +41,18 @@ vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
|||
}
|
||||
)
|
||||
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
||||
vim.lsp.handlers.hover, {
|
||||
border = O.lsp.popup_border
|
||||
}
|
||||
)
|
||||
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
|
||||
vim.lsp.handlers.signature_help, {
|
||||
border = O.lsp.popup_border
|
||||
}
|
||||
)
|
||||
|
||||
-- symbols for autocomplete
|
||||
vim.lsp.protocol.CompletionItemKind = {
|
||||
" (Text) ",
|
||||
|
|
|
@ -200,8 +200,8 @@ local mappings = {
|
|||
},
|
||||
f = { "<cmd>lua vim.lsp.buf.formatting()<cr>", "Format" },
|
||||
i = { "<cmd>LspInfo<cr>", "Info" },
|
||||
j = { "<cmd>lua vim.lsp.diagnostic.goto_next()<cr>", "Next Diagnostic" },
|
||||
k = { "<cmd>lua vim.lsp.diagnostic.goto_prev()<cr>", "Prev Diagnostic" },
|
||||
j = { "<cmd>lua vim.lsp.diagnostic.goto_next({popup_opts = {border = O.lsp.popup_border}})<cr>", "Next Diagnostic" },
|
||||
k = { "<cmd>lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = O.lsp.popup_border}})<cr>", "Prev Diagnostic" },
|
||||
q = { "<cmd>Telescope quickfix<cr>", "Quickfix" },
|
||||
r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
|
||||
s = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue