nvim
This commit is contained in:
parent
9acecb78d9
commit
bdf52d4710
1 changed files with 13 additions and 17 deletions
|
@ -43,8 +43,6 @@ local format_augroup = setmetatable({}, {
|
||||||
})
|
})
|
||||||
|
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
nmap("K", vim.lsp.buf.hover, "LSP hover", bufnr)
|
|
||||||
nmap("<C-]>", vim.lsp.buf.definition, "Go to definition", bufnr)
|
|
||||||
nmap("<Leader>r", vim.lsp.buf.rename, "Rename", bufnr)
|
nmap("<Leader>r", vim.lsp.buf.rename, "Rename", bufnr)
|
||||||
nmap("<Leader>cf", vim.lsp.buf.format, "Format document", bufnr)
|
nmap("<Leader>cf", vim.lsp.buf.format, "Format document", bufnr)
|
||||||
nmap("<Leader>ca", vim.lsp.buf.code_action, "Code actions", bufnr)
|
nmap("<Leader>ca", vim.lsp.buf.code_action, "Code actions", bufnr)
|
||||||
|
@ -52,7 +50,17 @@ local on_attach = function(client, bufnr)
|
||||||
nmap("<Leader>D", vim.lsp.buf.type_definition, "Go to type definition", bufnr)
|
nmap("<Leader>D", vim.lsp.buf.type_definition, "Go to type definition", bufnr)
|
||||||
nmap("gr", "<Cmd>Telescope lsp_references<CR>", "View references", bufnr)
|
nmap("gr", "<Cmd>Telescope lsp_references<CR>", "View references", bufnr)
|
||||||
|
|
||||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
if client.server_capabilities.completionProvider then
|
||||||
|
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||||
|
end
|
||||||
|
|
||||||
|
if client.server_capabilities.definitionProvider then
|
||||||
|
vim.api.nvim_buf_set_option(bufnr, "tagfunc", "v:lua.vim.lsp.tagfunc")
|
||||||
|
end
|
||||||
|
|
||||||
|
if client.server_capabilities.hoverProvider then
|
||||||
|
nmap("K", vim.lsp.buf.hover, "LSP hover", bufnr)
|
||||||
|
end
|
||||||
|
|
||||||
-- Highlight on cursor hold
|
-- Highlight on cursor hold
|
||||||
if client.server_capabilities.documentHighlightProvider then
|
if client.server_capabilities.documentHighlightProvider then
|
||||||
|
@ -87,20 +95,8 @@ end
|
||||||
|
|
||||||
local servers = {
|
local servers = {
|
||||||
gopls = {},
|
gopls = {},
|
||||||
intelephense = {
|
psalm = {
|
||||||
settings = {
|
cmd = { "./vendor/bin/psalm-language-server" },
|
||||||
intelephense = {
|
|
||||||
format = {
|
|
||||||
braces = "k&r",
|
|
||||||
},
|
|
||||||
telemetry = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
files = {
|
|
||||||
maxSize = 10000000,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
pylsp = {},
|
pylsp = {},
|
||||||
rust_analyzer = {
|
rust_analyzer = {
|
||||||
|
|
Loading…
Reference in a new issue