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
|
, enableTabby ? false
|
||||||
, viAlias ? false
|
, viAlias ? false
|
||||||
, vimAlias ? false
|
, vimAlias ? false
|
||||||
|
, grammarFileTypes ? [ "nix" ]
|
||||||
, theme ? { }
|
, theme ? { }
|
||||||
, wrapNeovim
|
, wrapNeovim
|
||||||
, neovim-unwrapped
|
, neovim-unwrapped
|
||||||
|
@ -22,7 +23,7 @@ let
|
||||||
plugins = callPlugins [
|
plugins = callPlugins [
|
||||||
./plugins/config
|
./plugins/config
|
||||||
(import ./plugins/syntax {
|
(import ./plugins/syntax {
|
||||||
inherit tree-sitter;
|
inherit tree-sitter grammarFileTypes;
|
||||||
})
|
})
|
||||||
./plugins/git
|
./plugins/git
|
||||||
./plugins/explorer
|
./plugins/explorer
|
||||||
|
|
|
@ -205,6 +205,7 @@
|
||||||
(neovim.override {
|
(neovim.override {
|
||||||
enableDevIcons = true;
|
enableDevIcons = true;
|
||||||
enableTabby = true;
|
enableTabby = true;
|
||||||
|
grammarFileTypes = [ "nix" "lua" ];
|
||||||
})
|
})
|
||||||
pkgs.stylua # lua formatter
|
pkgs.stylua # lua formatter
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,22 +1,11 @@
|
||||||
{ tree-sitter, ... }:
|
{ tree-sitter, grammarFileTypes, ... }:
|
||||||
|
|
||||||
{ nvim-treesitter, ... }:
|
{ nvim-treesitter, ... }:
|
||||||
|
|
||||||
|
|
||||||
let
|
let
|
||||||
treesitterGrammars = tree-sitter.withPlugins
|
treesitterGrammars = tree-sitter.withPlugins
|
||||||
(grammars: with grammars; [
|
(grammars: map (ft: grammars."tree-sitter-${ft}") grammarFileTypes);
|
||||||
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
|
|
||||||
]);
|
|
||||||
|
|
||||||
nvim-treesitter-with-grammars = nvim-treesitter.overrideAttrs (oldAttrs: {
|
nvim-treesitter-with-grammars = nvim-treesitter.overrideAttrs (oldAttrs: {
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
|
|
Reference in a new issue