|
|
|
local lsp = require('lsp-zero')
|
|
|
|
|
|
|
|
-- name = 'minimal',
|
|
|
|
-- set_lsp_keymaps = false,
|
|
|
|
-- manage_nvim_cmp = true,
|
|
|
|
-- suggest_lsp_servers = false,
|
|
|
|
--})
|
|
|
|
|
|
|
|
local keybindings = require('keybindings')
|
|
|
|
local on_attach = keybindings.on_attach
|
|
|
|
local cmp_mapping = keybindings.cmp_mappings
|
|
|
|
|
|
|
|
lsp.extend_lspconfig({
|
|
|
|
lsp_attach = on_attach,
|
|
|
|
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
|
|
|
})
|
|
|
|
|
|
|
|
local cmp = require('cmp')
|
|
|
|
local cmp_config = {
|
|
|
|
preselect = 'none',
|
|
|
|
window = {
|
|
|
|
completion = cmp.config.window.bordered(),
|
|
|
|
documentation = cmp.config.window.bordered(),
|
|
|
|
},
|
|
|
|
mapping = cmp.mapping.preset.insert(cmp_mappings),
|
|
|
|
sources = {
|
|
|
|
{ name = 'nvim_lsp' },
|
|
|
|
{ name = 'luasnip' },
|
|
|
|
},
|
|
|
|
experimental = {
|
|
|
|
ghost_text = false -- conflicts with copilot.vim's preview
|
|
|
|
},
|
|
|
|
}
|
|
|
|
cmp.setup(cmp_config)
|
|
|
|
|
|
|
|
lsp.configure('rust_analyzer', {
|
|
|
|
settings = {
|
|
|
|
["rust-analyzer"] = {
|
|
|
|
procMacro = {
|
|
|
|
enable = true,
|
|
|
|
ignored = {
|
|
|
|
leptos_macro = { "server" },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
cargo = {
|
|
|
|
allFeatures = true,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
lsp.configure('ts_ls', {
|
|
|
|
-- set commands to run the language server using npx
|
|
|
|
cmd = { "npx", "typescript-language-server", "--stdio" },
|
|
|
|
})
|
|
|
|
|
|
|
|
lsp.configure('html', {
|
|
|
|
cmd = { "npx", "vscode-html-language-server", "--stdio" },
|
|
|
|
})
|
|
|
|
|
|
|
|
lsp.configure('texlab', {
|
|
|
|
forwardSearch = {
|
|
|
|
executable = 'zathura',
|
|
|
|
args = { '--synctex-forward', '%l:1:%f', '%p' }
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
lsp.configure('clangd', {})
|
|
|
|
|
|
|
|
lsp.configure('pylsp', {})
|
|
|
|
|
|
|
|
-- gopls
|
|
|
|
lsp.configure('gopls', {})
|
|
|
|
|
|
|
|
lsp.setup_servers({'rust_analyzer', 'html', 'texlab', 'clangd', 'pylsp', 'gopls', 'ts_ls'})
|
|
|
|
|
|
|
|
lsp.setup()
|