Skip to content

Commit

Permalink
nixvim: partial fix for fenced syntaxes (see issue #14)
Browse files Browse the repository at this point in the history
  • Loading branch information
rummik committed Nov 30, 2022
1 parent f747ae9 commit 78261e0
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 19 deletions.
40 changes: 40 additions & 0 deletions pkgs/_sources/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,46 @@
},
"version": "24ceb4bfe666ca74f52ed3821a9f778c6324a84b"
},
"nvim-treesitter": {
"cargoLocks": null,
"date": "2022-11-28",
"extract": null,
"name": "nvim-treesitter",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "nvim-treesitter",
"repo": "nvim-treesitter",
"rev": "1821c656d8e42fd8ce6648af58e64268606e8bec",
"sha256": "sha256-NtHjCiYCVKvp2QCB92kXmvFbuA+4GM965hkFLDdIahY=",
"type": "github"
},
"version": "1821c656d8e42fd8ce6648af58e64268606e8bec"
},
"nvim-treesitter-textobjects": {
"cargoLocks": null,
"date": "2022-11-27",
"extract": null,
"name": "nvim-treesitter-textobjects",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "nvim-treesitter",
"repo": "nvim-treesitter-textobjects",
"rev": "98476e7364821989ab9b500e4d20d9ae2c5f6564",
"sha256": "sha256-0s/omiZhjC93MCTkLqD+lQObcldh6nz8jfkOOhTUc78=",
"type": "github"
},
"version": "98476e7364821989ab9b500e4d20d9ae2c5f6564"
},
"pass-secret-service": {
"cargoLocks": null,
"date": "2022-07-18",
Expand Down
24 changes: 24 additions & 0 deletions pkgs/_sources/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,30 @@
});
date = "2022-11-13";
};
nvim-treesitter = {
pname = "nvim-treesitter";
version = "1821c656d8e42fd8ce6648af58e64268606e8bec";
src = fetchFromGitHub ({
owner = "nvim-treesitter";
repo = "nvim-treesitter";
rev = "1821c656d8e42fd8ce6648af58e64268606e8bec";
fetchSubmodules = false;
sha256 = "sha256-NtHjCiYCVKvp2QCB92kXmvFbuA+4GM965hkFLDdIahY=";
});
date = "2022-11-28";
};
nvim-treesitter-textobjects = {
pname = "nvim-treesitter-textobjects";
version = "98476e7364821989ab9b500e4d20d9ae2c5f6564";
src = fetchFromGitHub ({
owner = "nvim-treesitter";
repo = "nvim-treesitter-textobjects";
rev = "98476e7364821989ab9b500e4d20d9ae2c5f6564";
fetchSubmodules = false;
sha256 = "sha256-0s/omiZhjC93MCTkLqD+lQObcldh6nz8jfkOOhTUc78=";
});
date = "2022-11-27";
};
pass-secret-service = {
pname = "pass-secret-service";
version = "fadc09be718ae1e507eeb8719f3a2ea23edb6d7a";
Expand Down
23 changes: 6 additions & 17 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,12 @@ final: prev: rec {
inherit sources;
}
// {
nvim-treesitter = prev.vimPlugins.nvim-treesitter.withAllGrammars.overrideAttrs (old:
old
// {
postInstall = let
# postFixup = let
inherit (prev.tree-sitter-grammars) tree-sitter-nix;
in
/*
bash
*/
''
echo patching nix injections
mv $out/queries/nix/injections.scm .
cat ${tree-sitter-nix}/queries/injections.scm injections.scm > $out/queries/nix/injections.scm
# exit 1
'';
});
nvim-treesitter = prev.vimPlugins.nvim-treesitter.withAllGrammars.overrideAttrs (old: rec {
inherit (sources.nvim-treesitter) src version;
name = "${old.pname}-${version}";
});

nvim-treesitter-textobjects = final.vimUtils.buildVimPlugin sources.nvim-treesitter-textobjects;
};

zshPlugins = import ./zsh-plugins {
Expand Down
8 changes: 8 additions & 0 deletions pkgs/sources.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ fetch.github = "haslersn/any-nix-shell"
src.git = "https://github.com/Shatur/neovim-session-manager"
fetch.github = "Shatur/neovim-session-manager"

[nvim-treesitter]
src.git = "https://github.com/nvim-treesitter/nvim-treesitter"
fetch.github = "nvim-treesitter/nvim-treesitter"

[nvim-treesitter-textobjects]
src.git = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects"
fetch.github = "nvim-treesitter/nvim-treesitter-textobjects"

[vim-just]
src.git = "https://github.com/NoahTheDuke/vim-just"
fetch.github = "NoahTheDuke/vim-just"
Expand Down
11 changes: 9 additions & 2 deletions users/profiles/nixvim/conf/treesitter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
enable = true;
indent = true;

# This lets us temporarily create an override to include the injections query from tree-sitter-nix
# See /overrides/knix.nix
disabledLanguages = [
"fish"
"help"
"tsx"
"typescript"
];

# This lets us temporarily create an override to update nvim-treesitter
# See /overlays/knix.nix
nixGrammars = false;
ensureInstalled = [];
};
Expand Down

0 comments on commit 78261e0

Please sign in to comment.