From 93571017f746bee464e26993e1e64868bbc48594 Mon Sep 17 00:00:00 2001 From: stitchy Date: Tue, 17 Dec 2024 11:01:21 +0000 Subject: [PATCH] nvim: add javascript syntax highlighting, lsp, and formatting --- config/nvim/nvim.lua | 3 ++- packages/default.nix | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/nvim/nvim.lua b/config/nvim/nvim.lua index a2aa1ff..7931289 100644 --- a/config/nvim/nvim.lua +++ b/config/nvim/nvim.lua @@ -37,7 +37,7 @@ local capabilities = require("cmp_nvim_lsp").default_capabilities() local lspconfig = require('lspconfig') -- Enable some language servers with the additional completion capabilities offered by nvim-cmp -local servers = { 'clangd', 'rust_analyzer', 'ts_ls', 'typst_lsp', 'vhdl_ls' } +local servers = { 'clangd', 'rust_analyzer', 'typst_lsp', 'vhdl_ls', 'vtsls' } for _, lsp in ipairs(servers) do lspconfig[lsp].setup { -- on_attach = my_custom_on_attach, @@ -108,6 +108,7 @@ require("conform").setup({ formatters_by_ft = { css = { "prettier", }, html = { "prettier", }, + javascript = { "prettier", }, python = { "black" }, }, format_on_save = { diff --git a/packages/default.nix b/packages/default.nix index 31755c0..0cf3b72 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -81,6 +81,7 @@ in "typst-lsp" "unzip" "vhdl-ls" + "vtsls" "wget" "zip" "zoxide" @@ -116,6 +117,8 @@ in nvim-lspconfig (nvim-treesitter.withPlugins ( plugins: with plugins; [ + glsl + javascript markdown ] ))