nvim: add javascript syntax highlighting, lsp, and formatting

This commit is contained in:
stitchy 2024-12-17 11:01:21 +00:00
parent 81b214586f
commit 93571017f7
Signed by: stitchy
SSH key fingerprint: SHA256:yz2SoxdnY67tfY5Jzb0f2v8f5W3o/IF359kbcquWip8
2 changed files with 5 additions and 1 deletions

View file

@ -37,7 +37,7 @@ local capabilities = require("cmp_nvim_lsp").default_capabilities()
local lspconfig = require('lspconfig') local lspconfig = require('lspconfig')
-- Enable some language servers with the additional completion capabilities offered by nvim-cmp -- 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 for _, lsp in ipairs(servers) do
lspconfig[lsp].setup { lspconfig[lsp].setup {
-- on_attach = my_custom_on_attach, -- on_attach = my_custom_on_attach,
@ -108,6 +108,7 @@ require("conform").setup({
formatters_by_ft = { formatters_by_ft = {
css = { "prettier", }, css = { "prettier", },
html = { "prettier", }, html = { "prettier", },
javascript = { "prettier", },
python = { "black" }, python = { "black" },
}, },
format_on_save = { format_on_save = {

View file

@ -81,6 +81,7 @@ in
"typst-lsp" "typst-lsp"
"unzip" "unzip"
"vhdl-ls" "vhdl-ls"
"vtsls"
"wget" "wget"
"zip" "zip"
"zoxide" "zoxide"
@ -116,6 +117,8 @@ in
nvim-lspconfig nvim-lspconfig
(nvim-treesitter.withPlugins ( (nvim-treesitter.withPlugins (
plugins: with plugins; [ plugins: with plugins; [
glsl
javascript
markdown markdown
] ]
)) ))