nvim config
This commit is contained in:
149
lua/plugins/lspconfig.lua
Normal file
149
lua/plugins/lspconfig.lua
Normal file
@@ -0,0 +1,149 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
}
|
||||
},
|
||||
config = function()
|
||||
local lspconfig = require('lspconfig')
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
|
||||
lspconfig.texlab.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
texlab = {
|
||||
build = {
|
||||
executable = 'latexmk',
|
||||
args = { '-pdf', '-interaction=nonstopmode', '-synctex=1', '%f' },
|
||||
onSave = true,
|
||||
},
|
||||
chktex = { onOpenAndSave = true }, -- Enables linting
|
||||
}
|
||||
}
|
||||
})
|
||||
lspconfig.rust_analyzer.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
},
|
||||
imports = {
|
||||
granularity = {
|
||||
group = "module",
|
||||
},
|
||||
prefix = "self",
|
||||
},
|
||||
cargo = {
|
||||
buildScripts = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
procMacro = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
lspconfig.lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = { version = 'LuaJIT' },
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = { vim.env.VIMRUNTIME },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
lspconfig.cssls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
scss = {
|
||||
validate = true
|
||||
},
|
||||
css = {
|
||||
validate = true
|
||||
}
|
||||
}
|
||||
})
|
||||
lspconfig.somesass_ls.setup({
|
||||
capabilities = capabilities,
|
||||
filetypes = { "sass", "scss" }
|
||||
})
|
||||
lspconfig.yamlls.setup({
|
||||
capabilities = capabilities,
|
||||
filetypes = { "yaml", "yaml.docker-compose", "yaml.gitlab" },
|
||||
settings = {
|
||||
yaml = {
|
||||
validate = true,
|
||||
hover = true,
|
||||
completion = true,
|
||||
format = {
|
||||
enable = true
|
||||
},
|
||||
schemaStore = {
|
||||
enable = true,
|
||||
url = "https://schemastore.org",
|
||||
},
|
||||
schemas = {
|
||||
["http://json.schemastore.org/github-workflow"] = ".github/workflows/*",
|
||||
["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
|
||||
["http://json.schemastore.org/prettierrc"] = ".prettierrc.{yml,yaml}",
|
||||
["http://json.schemastore.org/kustomization"] = "kustomization.{yml,yaml}",
|
||||
kubernetes = "*.yaml"
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
lspconfig.ts_ls.setup({
|
||||
capabilities = capabilities,
|
||||
init_options = {
|
||||
plugins = {
|
||||
{
|
||||
name = "@vue/typescript-plugin",
|
||||
location = "/usr/local/lib/node_modules/@vue/typescript-plugin",
|
||||
languages = {"javascript", "typescript", "vue"},
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
})
|
||||
lspconfig.bashls.setup({
|
||||
capabilities = capabilities,
|
||||
filetypes = { "sh", "bash", "zsh" },
|
||||
settings = {
|
||||
bashIde = {
|
||||
globPattern = "**/*@(.sh|.inc|.bash|.command|.zsh|zshrc|.zshrc|zsh_*|.zsh_*)"
|
||||
}
|
||||
},
|
||||
single_file_support = true
|
||||
})
|
||||
lspconfig.jsonls.setup({
|
||||
capabilities = capabilities
|
||||
})
|
||||
-- lspconfig.helm_ls.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- filetypes = { "helm" },
|
||||
-- settings = {
|
||||
-- ['helm_ls'] = {
|
||||
-- yamlls = {
|
||||
-- enabled = true,
|
||||
-- path = "yaml-language-server",
|
||||
-- enabledForFilesGlob = "*.{yaml,yml}",
|
||||
-- config = {
|
||||
-- schemas = {
|
||||
-- kubernetes = "templates/**",
|
||||
-- },
|
||||
-- completion = true,
|
||||
-- hover = true,
|
||||
-- },
|
||||
-- }
|
||||
-- }
|
||||
-- }
|
||||
-- })
|
||||
end,
|
||||
version = "~1.0.0"
|
||||
}
|
||||
Reference in New Issue
Block a user