nvim/lua/plugins/lspconfig.lua

66 lines
2 KiB
Lua
Raw Permalink Normal View History

2024-06-17 15:22:39 +07:00
return {
"nvim-lspconfig",
commit = "bc6ada4b0892b7f10852c0b8ca7209fd39a6d754",
2024-06-17 15:22:39 +07:00
init = function()
local keys = require("lazyvim.plugins.lsp.keymaps").get()
keys[#keys + 1] = {
"gD",
"<cmd>lua require('telescope.builtin').lsp_definitions({ jump_type = 'vsplit' })<cr>",
desc = "Jump to definitions in vsplit",
}
keys[#keys + 1] = {
"grr",
"<cmd>Trouble lsp_references focus=true<cr>",
desc = "Jump to references",
}
keys[#keys + 1] = {
"gri",
"<cmd>Trouble lsp_implementations focus=true<cr>",
desc = "Jump to references",
}
keys[#keys + 1] = {
"grt",
"<cmd>Trouble lsp_type_definitions focus=true<cr>",
desc = "Jump to references",
}
keys[#keys + 1] = {
"grs",
"<cmd>Trouble lsp_document_symbols focus=true<cr>",
desc = "Jump to references",
}
keys[#keys + 1] = {
"<F2>",
vim.lsp.buf.rename,
desc = "Rename Symbol",
}
keys[#keys + 1] = {
"<c-k>",
false,
mode = { "i" },
}
keys[#keys + 1] = {
"gr",
false,
}
end,
opts = {
servers = {
templ = {
on_attach = function(client, _)
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
end,
},
html = {
on_attach = function(client, _)
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
end,
},
2024-08-12 17:06:01 +07:00
lua_ls = {
mason = false,
},
2024-06-17 15:22:39 +07:00
},
},
}