From a19e1477f23d34fe66d0d9ae39720b68a6383fe4 Mon Sep 17 00:00:00 2001 From: joshashtondev Date: Sun, 8 Nov 2026 16:10:32 -0700 Subject: [PATCH] =?UTF-8?q?nixos:=20gen=20134=20@=20lilac=20=E2=80=94=2020?= =?UTF-8?q?26-11-08=2016:09=2026.05.20261105.c56a87d=20(Yarara)=20-----?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- home/programs/nvim.nix | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/home/programs/nvim.nix b/home/programs/nvim.nix index a709e27..86a4c7c 100644 --- a/home/programs/nvim.nix +++ b/home/programs/nvim.nix @@ -147,13 +147,11 @@ in }, }) - -- nvim-treesitter no longer exposes a configs module; highlighting is - -- started per buffer. Indent is deliberately left alone so treesitter - -- doesn't fight the Eclipse-matching tab settings below. vim.api.nvim_create_autocmd("FileType", { pattern = { - "java", "xml", "nix", "lua", "rs", "go", "gomod", + "java", "xml", "nix", "lua", "rust", "go", "gomod", "php", "sql", "html", "css", "scss", "javascript", + "javascriptreact", "typescript", "typescriptreact", "json", }, callback = function(args) pcall(vim.treesitter.start, args.buf) @@ -373,8 +371,8 @@ in capabilities = capabilities, init_options = { provideFormatter = true }, settings = { - css = { validate = true }, - scss = { validate = true }, + css = { validate = true, lint = { unknownAtRules = "ignore" } }, + scss = { validate = true, lint = { unknownAtRules = "ignore" } }, less = { validate = true }, }, on_attach = web_attach, @@ -396,7 +394,23 @@ in capabilities = capabilities, }) - vim.lsp.enable({ "phpactor", "sqls", "html", "cssls", "ts_ls", "emmet_ls" }) + vim.lsp.config("tailwindcss", { + cmd = { "tailwindcss-language-server", "--stdio" }, + filetypes = { "html", "css", "scss", "javascript", "javascriptreact", "typescript", "typescriptreact" }, + root_markers = { "tailwind.config.js", "tailwind.config.ts", "postcss.config.js", "postcss.config.mjs", "package.json", ".git" }, + capabilities = capabilities, + on_attach = web_attach, + }) + + vim.lsp.config("jsonls", { + cmd = { "vscode-json-language-server", "--stdio" }, + filetypes = { "json", "jsonc" }, + root_markers = { "package.json", ".git" }, + capabilities = capabilities, + init_options = { provideFormatter = true }, + on_attach = web_attach, + }) + vim.lsp.enable({ "phpactor", "sqls", "html", "cssls", "ts_ls", "emmet_ls", "tailwindcss", "jsonls" }) -- Linters (diagnostics): run on open and save. phpstan can be slow on -- big projects, so it is deliberately not run on every keystroke. @@ -592,7 +606,7 @@ in { plugin = rustaceanvim; } { plugin = nvim-lint; } { plugin = conform-nvim; } - { plugin = (nvim-treesitter.withPlugins (p: [ p.java p.xml p.nix p.lua p.rust p.go p.gomod p.php p.sql p.html p.css p.javascript ])); } + { plugin = (nvim-treesitter.withPlugins (p: [ p.java p.xml p.nix p.lua p.rust p.go p.gomod p.php p.sql p.html p.css p.javascript p.typescript p.tsx p.json ])); } { plugin = vim-obsession; } ];