merge treesitter into app.nix
I'm uncertain if I moved the plugins over (I think they are all enabled by default)
This commit is contained in:
parent
849cc08db4
commit
f3aad89088
2 changed files with 6 additions and 41 deletions
|
|
@ -28,8 +28,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# ./plugin/treesitter.nix
|
|
||||||
|
|
||||||
config = lib.mkIf config.neovim.enable {
|
config = lib.mkIf config.neovim.enable {
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
EDITOR = "nvim";
|
EDITOR = "nvim";
|
||||||
|
|
@ -136,7 +134,12 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
treesitter.enable = treesiter.enable;
|
treesitter = {
|
||||||
|
enable = treesiter.enable;
|
||||||
|
highlight.enable = true;
|
||||||
|
indent.enable = true;
|
||||||
|
folding.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
vimwiki = {
|
vimwiki = {
|
||||||
enable = wiki.enable;
|
enable = wiki.enable;
|
||||||
|
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
{ 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 },
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
# I've tried many things, and can't get treesitter plugins changing
|
|
||||||
# dynamically. For not just have them always loaded regardless of config
|
|
||||||
treeplugs = p: [
|
|
||||||
p.tree-sitter-c
|
|
||||||
p.tree-sitter-go
|
|
||||||
p.tree-sitter-nix
|
|
||||||
p.tree-sitter-rust
|
|
||||||
p.tree-sitter-typescript
|
|
||||||
];
|
|
||||||
in with pkgs.vimPlugins; [
|
|
||||||
{
|
|
||||||
plugin = (nvim-treesitter.withPlugins treeplugs);
|
|
||||||
type = "lua";
|
|
||||||
config = configText;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue