Browse Source

nixpkgs/neovim: add support for elvish

Thomas Dy 2 years ago
parent
commit
79f260be9c

+ 18 - 0
.config/nixpkgs/neovim/lsp.lua

@@ -90,5 +90,23 @@ null_ls.setup({
   end,
 });
 
+-- custom LSP servers
+local configs = require('lspconfig.configs')
+
+if not configs.elvish then
+  configs.elvish = {
+    default_config = {
+      cmd = {'elvish', '--lsp'},
+      filetypes = {'elvish'},
+      root_dir = nvim_lsp.util.root_pattern('*.elv'),
+      settings = {},
+    },
+  }
+end
+
+nvim_lsp.elvish.setup({
+  on_attach = on_attach,
+})
+
 -- show LSP progress bar
 require('fidget').setup()

+ 11 - 0
.config/nixpkgs/neovim/plugins.nix

@@ -197,6 +197,17 @@
       sha256 = "0ssmn8lr4mgi8wcckaym3qnjg3m3l67a5avbsc3yj6igavv7c7mb";
     };
 
+    dontBuild = true;
+  })
+  (buildNeovimPlugin {
+    name = "vim-syntax-elvish";
+    src = fetchFromGitHub {
+      owner = "chlorm";
+      repo = "vim-syntax-elvish";
+      rev = "53068bcec7209422df4494f5fdb1202f5937ccea";
+      sha256 = "08yyc7l3r0nqr43c25aag7a6dif9hzflw6x1b06rzfqbchhl60rw";
+    };
+
     dontBuild = true;
   })
 ]

+ 1 - 0
.config/nixpkgs/neovim/update.sh

@@ -47,5 +47,6 @@ add_plugin jose-elias-alvarez typescript.nvim
 add_plugin jose-elias-alvarez null-ls.nvim
 add_plugin j-hui fidget.nvim
 add_plugin sainnhe sonokai
+add_plugin chlorm vim-syntax-elvish
 
 echo "]"