diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index 1c5065a..1f37e04 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -104,11 +104,14 @@ with final.pkgs.lib; let jdt-language-server # java ls nixd # nix LSP rust-analyzer # rust LSP + vscode-langservers-extracted # various web dev lsps from vscode + typescript-language-server # css lsp thing # autoformatters alejandra # amazing nix autoformatter stylua # lua formatter rustfmt # rust formatter + prettierd # typescript/javascript formatter # google-java-format # java formatter based off google guidelines # misc diff --git a/nvim/ftplugin/css.lua b/nvim/ftplugin/css.lua new file mode 100644 index 0000000..d7b8c37 --- /dev/null +++ b/nvim/ftplugin/css.lua @@ -0,0 +1,15 @@ +-- Exit if the language server isn't available +if vim.fn.executable('vscode-css-language-server') ~= 1 then + return +end + +local root_files = { + '.git', +} + +vim.lsp.start { + name = 'cssls', + cmd = { 'vscode-css-language-server', '--stdio' }, + root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]), + capabilities = require('user.lsp').make_client_capabilities(), +} diff --git a/nvim/ftplugin/typescript.lua b/nvim/ftplugin/typescript.lua new file mode 100644 index 0000000..352fd1b --- /dev/null +++ b/nvim/ftplugin/typescript.lua @@ -0,0 +1,15 @@ +-- Exit if the language server isn't available +if vim.fn.executable('typescript-language-server') ~= 1 then + return +end + +local root_files = { + '.git', +} + +vim.lsp.start { + name = 'ts_ls', + cmd = { 'typescript-language-server', '--stdio' }, + root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]), + capabilities = require('user.lsp').make_client_capabilities(), +} diff --git a/nvim/plugin/conform.lua b/nvim/plugin/conform.lua index 954dcd4..af3e755 100644 --- a/nvim/plugin/conform.lua +++ b/nvim/plugin/conform.lua @@ -3,6 +3,7 @@ require('conform').setup { lua = { 'stylua' }, nix = { 'alejandra' }, rust = { 'rustfmt' }, + typescript = { 'prettierd' }, -- Conform will run multiple formatters sequentially -- python = { "isort", "black" }, -- You can customize some of the format options for the filetype (:help conform.format)