plugins/syntax: config ts grammar file types via override
This commit is contained in:
parent
cf97347ae5
commit
116764c3a0
3 changed files with 5 additions and 14 deletions
|
@ -3,6 +3,7 @@
|
|||
, enableTabby ? false
|
||||
, viAlias ? false
|
||||
, vimAlias ? false
|
||||
, grammarFileTypes ? [ "nix" ]
|
||||
, theme ? { }
|
||||
, wrapNeovim
|
||||
, neovim-unwrapped
|
||||
|
@ -22,7 +23,7 @@ let
|
|||
plugins = callPlugins [
|
||||
./plugins/config
|
||||
(import ./plugins/syntax {
|
||||
inherit tree-sitter;
|
||||
inherit tree-sitter grammarFileTypes;
|
||||
})
|
||||
./plugins/git
|
||||
./plugins/explorer
|
||||
|
|
|
@ -205,6 +205,7 @@
|
|||
(neovim.override {
|
||||
enableDevIcons = true;
|
||||
enableTabby = true;
|
||||
grammarFileTypes = [ "nix" "lua" ];
|
||||
})
|
||||
pkgs.stylua # lua formatter
|
||||
];
|
||||
|
|
|
@ -1,22 +1,11 @@
|
|||
{ tree-sitter, ... }:
|
||||
{ tree-sitter, grammarFileTypes, ... }:
|
||||
|
||||
{ nvim-treesitter, ... }:
|
||||
|
||||
|
||||
let
|
||||
treesitterGrammars = tree-sitter.withPlugins
|
||||
(grammars: with grammars; [
|
||||
tree-sitter-nix
|
||||
tree-sitter-lua
|
||||
tree-sitter-ledger
|
||||
tree-sitter-yaml
|
||||
tree-sitter-json
|
||||
tree-sitter-typescript
|
||||
tree-sitter-javascript
|
||||
tree-sitter-rust
|
||||
tree-sitter-haskell
|
||||
tree-sitter-bash
|
||||
]);
|
||||
(grammars: map (ft: grammars."tree-sitter-${ft}") grammarFileTypes);
|
||||
|
||||
nvim-treesitter-with-grammars = nvim-treesitter.overrideAttrs (oldAttrs: {
|
||||
postPatch = ''
|
||||
|
|
Reference in a new issue