nvim: lsp: show help on hover
This commit is contained in:
parent
30416dbd26
commit
16623c3ac2
|
@ -38,24 +38,31 @@ packer.use {
|
|||
hi! LspReferenceText cterm=bold ctermbg=red guibg=#633466
|
||||
hi! LspReferenceWrite cterm=bold ctermbg=red guibg=#633466
|
||||
]]
|
||||
vim.api.nvim_create_augroup('lsp_document_highlight', {
|
||||
clear = false
|
||||
})
|
||||
vim.api.nvim_create_augroup('config_lsp', { clear = false })
|
||||
vim.api.nvim_clear_autocmds({
|
||||
buffer = bufnr,
|
||||
group = 'lsp_document_highlight',
|
||||
group = 'config_lsp',
|
||||
})
|
||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||
group = 'lsp_document_highlight',
|
||||
group = 'config_lsp',
|
||||
buffer = bufnr,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
vim.api.nvim_create_autocmd('CursorMoved', {
|
||||
group = 'lsp_document_highlight',
|
||||
group = 'config_lsp',
|
||||
buffer = bufnr,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
end
|
||||
|
||||
-- show help on hover
|
||||
if client.resolved_capabilities.hover then
|
||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||
group = 'config_lsp',
|
||||
buffer = bufnr,
|
||||
callback = vim.lsp.buf.hover,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- update client capabilities with completion plugin stuff
|
||||
|
|
Loading…
Reference in New Issue
Block a user