diff options
| author | Polesznyák Márk <contact@pml68.dev> | 2026-04-04 03:16:27 +0200 |
|---|---|---|
| committer | Polesznyák Márk <contact@pml68.dev> | 2026-04-04 10:12:16 +0200 |
| commit | 8bb513a86e8bea07fdb8cea71d254d46ffc7806b (patch) | |
| tree | 745bd411d173e4da9355b214dc74edde08f42692 /plugin/30-lspconfig.lua | |
| parent | feat: enable ui2, add back LspLog command (diff) | |
| download | nvim-8bb513a86e8bea07fdb8cea71d254d46ffc7806b.tar.gz | |
feat!: migrate to vim.pack
Diffstat (limited to 'plugin/30-lspconfig.lua')
| -rw-r--r-- | plugin/30-lspconfig.lua | 58 |
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) |
