refactor(nvim)!: add opts option
This commit is contained in:
parent
12a5420ee9
commit
6a125a1df6
27 changed files with 273 additions and 238 deletions
42
modules/programs/nvim/plugins/treesitter.nix
Normal file
42
modules/programs/nvim/plugins/treesitter.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ lib, pkgs, ... }:
|
||||
|
||||
with builtins;
|
||||
{
|
||||
config.my.programs.nvim.plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = nvim-treesitter;
|
||||
event = [ "BufReadPost" "BufNewFile" ];
|
||||
conf =
|
||||
let
|
||||
parserDir = pkgs.symlinkJoin {
|
||||
name = "tresitter-grammars-all";
|
||||
paths = lib.attrValues (lib.filterAttrs (_: builtins.isAttrs) nvim-treesitter-parsers);
|
||||
};
|
||||
in
|
||||
readFile ./lua/nvim-treesitter.lua + ''
|
||||
vim.opt.runtimepath:append("${parserDir}")
|
||||
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
parser_install_dir = "${parserDir}",
|
||||
}
|
||||
'';
|
||||
dependencies = [
|
||||
{ plugin = nvim-ts-context-commentstring; }
|
||||
];
|
||||
}
|
||||
{
|
||||
plugin = nvim-treesitter-textsubjects;
|
||||
event = [ "BufReadPost" "BufNewFile" ];
|
||||
conf = readFile ./lua/nvim-treesitter-textsubjects.lua;
|
||||
}
|
||||
{
|
||||
plugin = nvim-treesitter-context;
|
||||
event = [ "BufReadPost" "BufNewFile" ];
|
||||
opts = { };
|
||||
}
|
||||
{
|
||||
plugin = hmts-nvim;
|
||||
ft = [ "nix" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue