1
0
Fork 0

nvim: lsp: disable help on hover again

too annoying
This commit is contained in:
tastytea 2022-08-17 04:02:24 +02:00
parent dbd3eb7db3
commit 6d81305669
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 17 additions and 16 deletions

View File

@ -5,6 +5,7 @@ local map = require('my.functions').map
-- only do this after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
---@format disable
map('n', '<f5>', vim.diagnostic.goto_prev, nil, bufnr)
map('n', '<f6>', vim.diagnostic.goto_next, nil, bufnr)
map('n', 'gD', vim.lsp.buf.declaration, 'Go to declaration', bufnr)
@ -64,14 +65,14 @@ local on_attach = function(client, bufnr)
}, bufnr)
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
-- -- 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
@ -87,7 +88,7 @@ vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
-- setup servers
if vim.fn.executable('clangd') > 0 then
require 'lspconfig'.clangd.setup {
require('lspconfig').clangd.setup {
cmd = {
'clangd',
'--compile-commands-dir=build',
@ -100,7 +101,7 @@ if vim.fn.executable('clangd') > 0 then
end
if vim.fn.executable('lua-language-server') > 0 then
require 'lspconfig'.sumneko_lua.setup({
require('lspconfig').sumneko_lua.setup({
settings = {
Lua = {
runtime = {
@ -127,7 +128,7 @@ if vim.fn.executable('lua-language-server') > 0 then
end
if vim.fn.executable('pylsp') > 0 then
require 'lspconfig'.pylsp.setup({
require('lspconfig').pylsp.setup({
settings = {
pylsp = {
}
@ -138,7 +139,7 @@ if vim.fn.executable('pylsp') > 0 then
end
if vim.fn.executable('lemminx') > 0 then
require 'lspconfig'.lemminx.setup({
require('lspconfig').lemminx.setup({
filetypes = {
'xml', 'xsd', 'xsl', 'xslt', 'svg', 'gentoo-metadata'
},
@ -148,28 +149,28 @@ if vim.fn.executable('lemminx') > 0 then
end
if vim.fn.executable('vscode-html-language-server') > 0 then
require 'lspconfig'.html.setup({
require('lspconfig').html.setup({
on_attach = on_attach,
capabilities = capabilities
})
end
if vim.fn.executable('vscode-css-language-server') > 0 then
require 'lspconfig'.cssls.setup({
require('lspconfig').cssls.setup({
on_attach = on_attach,
capabilities = capabilities
})
end
if vim.fn.executable('vscode-eslint-language-server') > 0 then
require 'lspconfig'.eslint.setup({
require('lspconfig').eslint.setup({
on_attach = on_attach,
capabilities = capabilities
})
end
if vim.fn.executable('vscode-json-language-server') > 0 then
require 'lspconfig'.jsonls.setup({
require('lspconfig').jsonls.setup({
on_attach = on_attach,
capabilities = capabilities
})