mirror of
https://github.com/boxpositron/absolute-vim.git
synced 2026-10-24 05:23:19 +00:00
feat(nvim): phase 1 — triage and abandoned-plugin cleanup
Fix keymap collision on <leader>j/<leader>k (now resize-only;
location-list moved to ]l/[l). Migrate diagnostic signs from
deprecated vim.fn.sign_define to vim.diagnostic.config. Drop
orphan after/nvim-tree.lua and the bogus require("../current-theme").
Add foundation snacks.nvim spec. Remove playground, vim-maximizer,
poet-v, git-blame, render-markdown, and all five AI plugin specs.
Enable gitsigns current_line_blame.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
-- Setup language servers.
|
||||
local conform = require("conform")
|
||||
local lspconfig = require("lspconfig")
|
||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
@@ -70,27 +69,25 @@ end
|
||||
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
|
||||
-- Change the Diagnostic symbols in the sign column (gutter)
|
||||
local signs = {
|
||||
Error = " ",
|
||||
Warn = " ",
|
||||
Hint = " ",
|
||||
Info = " ",
|
||||
}
|
||||
-- Configure diagnostic signs (Neovim 0.10+ API; required in 0.12)
|
||||
vim.diagnostic.config({
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = " ",
|
||||
[vim.diagnostic.severity.WARN] = " ",
|
||||
[vim.diagnostic.severity.HINT] = " ",
|
||||
[vim.diagnostic.severity.INFO] = " ",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||
end
|
||||
|
||||
-- configure html server
|
||||
lspconfig["html"].setup({
|
||||
-- Configure LSP servers using vim.lsp.config
|
||||
vim.lsp.config("html", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure typescript server with plugin
|
||||
lspconfig["ts_ls"].setup({
|
||||
vim.lsp.config("ts_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
init_options = {
|
||||
@@ -105,21 +102,18 @@ lspconfig["ts_ls"].setup({
|
||||
filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" },
|
||||
})
|
||||
|
||||
-- configure css server
|
||||
lspconfig["cssls"].setup({
|
||||
vim.lsp.config("cssls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure tailwindcss server
|
||||
lspconfig["tailwindcss"].setup({
|
||||
vim.lsp.config("tailwindcss", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
filetypes = { "html", "svelte", "vue", "astro" },
|
||||
})
|
||||
|
||||
-- configure svelte server
|
||||
lspconfig["svelte"].setup({
|
||||
vim.lsp.config("svelte", {
|
||||
capabilities = capabilities,
|
||||
on_attach = function(client, bufnr)
|
||||
on_attach(client, bufnr)
|
||||
@@ -135,8 +129,7 @@ lspconfig["svelte"].setup({
|
||||
end,
|
||||
})
|
||||
|
||||
-- configure emmet language server
|
||||
lspconfig["emmet_ls"].setup({
|
||||
vim.lsp.config("emmet_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
filetypes = {
|
||||
@@ -153,14 +146,12 @@ lspconfig["emmet_ls"].setup({
|
||||
},
|
||||
})
|
||||
|
||||
-- configure ruff server
|
||||
lspconfig["ruff"].setup({
|
||||
vim.lsp.config("ruff", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure pyright server
|
||||
lspconfig["pyright"].setup({
|
||||
vim.lsp.config("pyright", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
filetypes = { "python" },
|
||||
@@ -175,20 +166,17 @@ lspconfig["pyright"].setup({
|
||||
},
|
||||
})
|
||||
|
||||
-- configure docker server
|
||||
lspconfig["dockerls"].setup({
|
||||
vim.lsp.config("dockerls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure json server
|
||||
lspconfig["jsonls"].setup({
|
||||
vim.lsp.config("jsonls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure vue server
|
||||
lspconfig["volar"].setup({
|
||||
vim.lsp.config("vue_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
filetypes = { "vue" },
|
||||
@@ -221,9 +209,7 @@ lspconfig["volar"].setup({
|
||||
},
|
||||
})
|
||||
|
||||
-- configure rust server
|
||||
lspconfig.rust_analyzer.setup({
|
||||
-- Server-specific settings. See `:help lspconfig-setup`
|
||||
vim.lsp.config("rust_analyzer", {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
@@ -231,18 +217,15 @@ lspconfig.rust_analyzer.setup({
|
||||
},
|
||||
})
|
||||
|
||||
-- configure lua server (with special settings)
|
||||
lspconfig["lua_ls"].setup({
|
||||
vim.lsp.config("lua_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = { -- custom settings for lua
|
||||
settings = {
|
||||
Lua = {
|
||||
-- make the language server recognize "vim" global
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- make language server aware of runtime files
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||
@@ -252,73 +235,45 @@ lspconfig["lua_ls"].setup({
|
||||
},
|
||||
})
|
||||
|
||||
-- configure css server
|
||||
lspconfig["cssls"].setup({
|
||||
vim.lsp.config("docker_compose_language_service", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
--configure docker file server
|
||||
lspconfig["dockerls"].setup({
|
||||
vim.lsp.config("eslint", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure docker compose server
|
||||
lspconfig["docker_compose_language_service"].setup({
|
||||
vim.lsp.config("astro", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure eslint server
|
||||
lspconfig["eslint"].setup({
|
||||
vim.lsp.config("kotlin_language_server", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure astro server
|
||||
lspconfig["astro"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
-- init_options = {
|
||||
-- typescript = {
|
||||
-- tsdk = ResolveTypescriptServer(),
|
||||
-- },
|
||||
-- },
|
||||
})
|
||||
|
||||
-- configure kotlin server
|
||||
lspconfig["kotlin_language_server"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure clang server
|
||||
|
||||
lspconfig["clangd"].setup({
|
||||
vim.lsp.config("clangd", {
|
||||
cmd = { "clangd", "--compile-commands-dir=./", "--background-index=false" },
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
filetypes = { "c", "cpp", "objc", "objcpp" },
|
||||
})
|
||||
|
||||
-- configure bufls server
|
||||
|
||||
lspconfig["buf_ls"].setup({
|
||||
vim.lsp.config("buf_ls", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
filetypes = { "proto" },
|
||||
})
|
||||
|
||||
-- configure arduino language server
|
||||
|
||||
lspconfig["arduino_language_server"].setup({
|
||||
vim.lsp.config("arduino_language_server", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure biome server
|
||||
lspconfig["biome"].setup({
|
||||
vim.lsp.config("biome", {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
filetypes = {
|
||||
@@ -334,3 +289,28 @@ lspconfig["biome"].setup({
|
||||
"vue",
|
||||
},
|
||||
})
|
||||
|
||||
-- Enable all configured LSP servers
|
||||
vim.lsp.enable({
|
||||
"html",
|
||||
"ts_ls",
|
||||
"cssls",
|
||||
"tailwindcss",
|
||||
"svelte",
|
||||
"emmet_ls",
|
||||
"ruff",
|
||||
"pyright",
|
||||
"dockerls",
|
||||
"jsonls",
|
||||
"vue_ls",
|
||||
"rust_analyzer",
|
||||
"lua_ls",
|
||||
"docker_compose_language_service",
|
||||
"eslint",
|
||||
"astro",
|
||||
"kotlin_language_server",
|
||||
"clangd",
|
||||
"buf_ls",
|
||||
"arduino_language_server",
|
||||
"biome",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user