aboutsummaryrefslogtreecommitdiff
path: root/plugin/30-lspconfig.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/30-lspconfig.lua')
-rw-r--r--plugin/30-lspconfig.lua58
1 files changed, 58 insertions, 0 deletions
diff --git a/plugin/30-lspconfig.lua b/plugin/30-lspconfig.lua
new file mode 100644
index 0000000..d8a9cfc
--- /dev/null
+++ b/plugin/30-lspconfig.lua
@@ -0,0 +1,58 @@
+local servers = {
+ -- "asm_lsp",
+ "html",
+ "ts_ls",
+ "cssls",
+ "svelte",
+ "bashls",
+ "clangd",
+ "pyright",
+ "emmet_language_server",
+ "jsonls",
+ "rust_analyzer",
+ "kotlin_lsp",
+ "lua_ls",
+ "glsl_analyzer",
+ "csharp_ls",
+ "unocss",
+}
+
+vim.api.nvim_create_autocmd({ "BufEnter" }, {
+ pattern = { "build.sh", "*.subpackage.sh", "PKGBUILD", "*.install",
+ "makepkg.conf", "*.ebuild", "*.eclass", "color.map", "make.conf" },
+ callback = function()
+ vim.lsp.start({
+ name = "termux",
+ cmd = { "termux-language-server" }
+ })
+ end,
+})
+
+vim.api.nvim_create_autocmd({ "BufEnter" }, {
+ once = true,
+ pattern = { "Cargo.toml" },
+ callback = function()
+ vim.pack.add({ "https://github.com/saecki/crates.nvim" })
+ require("crates").setup({
+ lsp = {
+ enabled = true,
+ actions = true,
+ completion = true,
+ hover = true,
+ },
+ })
+
+ vim.keymap.set("n", "<leader>rcu", function()
+ require("crates").upgrade_all_crates()
+ end)
+ end,
+})
+
+vim.lsp.config('*', {
+ on_attach = function(client, bufnr)
+ vim.pack.add({ "https://github.com/artemave/workspace-diagnostics.nvim" })
+ require("workspace-diagnostics").populate_workspace_diagnostics(client, bufnr)
+ end
+})
+
+vim.lsp.enable(servers)