refactor(nvim): update for new lspconfig
This commit is contained in:
parent
bfca019cbb
commit
74c5ae1ba9
1 changed files with 22 additions and 23 deletions
|
@ -1,8 +1,32 @@
|
||||||
-- This will need some refactoring as it is mostly a
|
-- This will need some refactoring as it is mostly a
|
||||||
-- copy and paste from the previous single-file .vim config
|
-- copy and paste from the previous single-file .vim config
|
||||||
|
|
||||||
require'lspconfig'.pylsp.setup{
|
require'nvim-treesitter.configs'.setup {
|
||||||
|
ensure_installed = { },
|
||||||
|
auto_install = false,
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Add additional capabilities supported by nvim-cmp
|
||||||
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
|
-- Enable some language servers with the additional completion capabilities offered by nvim-cmp
|
||||||
|
local servers = { 'clangd', 'glsl_analyzer', 'nixd', 'pylsp', 'rust_analyzer', 'texlab', 'tinymist', 'verible', 'vhdl_ls', 'vtsls' }
|
||||||
|
for _, lsp in ipairs(servers) do
|
||||||
|
vim.lsp.enable(lsp)
|
||||||
|
vim.lsp.config(lsp, {
|
||||||
|
-- on_attach = my_custom_on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
|
['rust-analyzer'] = {
|
||||||
|
cargo = {
|
||||||
|
allFeatures = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
['pylsp'] = {
|
||||||
formatCommand = {"black"},
|
formatCommand = {"black"},
|
||||||
pylsp = {
|
pylsp = {
|
||||||
plugins = {
|
plugins = {
|
||||||
|
@ -18,35 +42,9 @@ require'lspconfig'.pylsp.setup{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
require'nvim-treesitter.configs'.setup {
|
|
||||||
ensure_installed = { },
|
|
||||||
auto_install = false,
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
additional_vim_regex_highlighting = false,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Add additional capabilities supported by nvim-cmp
|
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
|
||||||
|
|
||||||
local lspconfig = require('lspconfig')
|
|
||||||
|
|
||||||
-- Enable some language servers with the additional completion capabilities offered by nvim-cmp
|
|
||||||
local servers = { 'clangd', 'glsl_analyzer', 'nixd', 'rust_analyzer', 'texlab', 'tinymist', 'verible', 'vhdl_ls', 'vtsls' }
|
|
||||||
for _, lsp in ipairs(servers) do
|
|
||||||
lspconfig[lsp].setup {
|
|
||||||
-- on_attach = my_custom_on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
settings = {
|
|
||||||
['rust-analyzer'] = {
|
|
||||||
cargo = {
|
|
||||||
allFeatures = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- luasnip setup
|
-- luasnip setup
|
||||||
|
@ -172,6 +170,7 @@ require("spaceman").setup({
|
||||||
"~/Documents/Classes",
|
"~/Documents/Classes",
|
||||||
"~/Documents/Repos",
|
"~/Documents/Repos",
|
||||||
"~/Documents/Repos/ExtremeHeatTransfer",
|
"~/Documents/Repos/ExtremeHeatTransfer",
|
||||||
|
"~/Documents/Repos/SemiconductorLab",
|
||||||
"/opt/docker-containers/",
|
"/opt/docker-containers/",
|
||||||
},
|
},
|
||||||
use_default_keymaps = true,
|
use_default_keymaps = true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue