Neovim, refactor to use modules, lua, and LSP
Refactors the neovim config to use nix modules, and changes the plugins to favor the builtin neovim LSP over COC. Changes all code to use lua code instead of vimscript.
This commit is contained in:
parent
02fe68372c
commit
2b24d4e454
8 changed files with 337 additions and 134 deletions
30
hmModules/apps/neovim/plugin/treesitter.nix
Normal file
30
hmModules/apps/neovim/plugin/treesitter.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
cfgp = config.neovim.plugins;
|
||||
cfgl = config.neovim.languages;
|
||||
in {
|
||||
config = lib.mkIf (config.neovim.enable && cfgp.treesitter.enable) {
|
||||
programs.neovim.plugins = let
|
||||
configText = ''
|
||||
require('nvim-treesitter.configs').setup {
|
||||
ensure_installed = {},
|
||||
|
||||
auto_install = false,
|
||||
|
||||
highlight = { enable = true },
|
||||
|
||||
indent = { enable = true },
|
||||
}
|
||||
'';
|
||||
|
||||
treeplugs = p: lib.lists.optional cfgl.nix.enable p.tree-sitter-nix;
|
||||
in with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = (nvim-treesitter.withPlugins treeplugs);
|
||||
type = "lua";
|
||||
config = configText;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue