From 7b37393bc5e4622f9a8865eeecf8144685dc0045 Mon Sep 17 00:00:00 2001 From: Bad Date: Wed, 17 Aug 2022 01:26:57 +0200 Subject: [PATCH] Split ts lsp into a separate file --- users/modules/neovim/default.nix | 1 + users/modules/neovim/js.nix | 26 ++++++++++++++++++++++++++ users/profiles/neovim/default.nix | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 users/modules/neovim/js.nix diff --git a/users/modules/neovim/default.nix b/users/modules/neovim/default.nix index 79775b6..3ac1c7d 100644 --- a/users/modules/neovim/default.nix +++ b/users/modules/neovim/default.nix @@ -5,6 +5,7 @@ let in { imports = [ + ./js.nix ./go.nix ./rust.nix ./web_dev.nix diff --git a/users/modules/neovim/js.nix b/users/modules/neovim/js.nix new file mode 100644 index 0000000..f210c4e --- /dev/null +++ b/users/modules/neovim/js.nix @@ -0,0 +1,26 @@ +{ lib, pkgs, config, ... }: +let + cfg = config.mae.nvim; +in +with lib; +{ + options.mae.nvim.js = { + tsserver.enable = mkEnableOption "Enable js/ts support in nvim with tsserver"; + }; + + config = mkIf cfg.js.tsserver.enable { + programs.neovim = { + coc.enable = true; + plugins = with pkgs.vimPlugins; [ + coc-tsserver + { + plugin = vim-jsdoc; + config = '' + let g:jsdoc_formatter = "tsdoc" + let g:typescript_indent_disable = 1 + ''; + } + ]; + }; + }; +} diff --git a/users/profiles/neovim/default.nix b/users/profiles/neovim/default.nix index ace38a0..438b923 100644 --- a/users/profiles/neovim/default.nix +++ b/users/profiles/neovim/default.nix @@ -2,7 +2,7 @@ { mae.nvim = { enable = true; - js.enable = true; + # js.tsserver.enable = true; nix.enable = true; rust.enable = true; clangd.enable = true;