mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-12 05:27:50 +00:00
feat: update from builtGrammars to grammarPlugins
This commit is contained in:
parent
9c75c2a199
commit
a5b0fe40af
8 changed files with 10 additions and 10 deletions
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
mkGrammarOption = pkgs: grammar:
|
mkGrammarOption = pkgs: grammar:
|
||||||
mkPackageOption pkgs ["${grammar} treesitter"] {
|
mkPackageOption pkgs ["${grammar} treesitter"] {
|
||||||
default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar];
|
default = ["vimPlugins" "nvim-treesitter" "grammarPlugins" grammar];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
inherit diagnostics diagnosticSubmodule mkGrammarOption;
|
inherit diagnostics diagnosticSubmodule mkGrammarOption;
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,7 @@ in {
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "Python treesitter grammar to use";
|
description = "Python treesitter grammar to use";
|
||||||
type = package;
|
type = package;
|
||||||
default = pkgs.vimPlugins.nvim-treesitter.builtGrammars.python;
|
default = pkgs.vimPlugins.nvim-treesitter.grammarPlugins.python;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ in {
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = package;
|
type = package;
|
||||||
default = pkgs.vimPlugins.nvim-treesitter.builtGrammars.sql;
|
default = pkgs.vimPlugins.nvim-treesitter.grammarPlugins.sql;
|
||||||
description = "SQL treesitter grammar to use";
|
description = "SQL treesitter grammar to use";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ in {
|
||||||
|
|
||||||
pluginRC.orgmode = entryAnywhere ''
|
pluginRC.orgmode = entryAnywhere ''
|
||||||
-- Treesitter configuration
|
-- Treesitter configuration
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter').setup {
|
||||||
|
|
||||||
-- If TS highlights are not enabled at all, or disabled via `disable` prop,
|
-- If TS highlights are not enabled at all, or disabled via `disable` prop,
|
||||||
-- highlighting will fallback to default Vim syntax highlighting
|
-- highlighting will fallback to default Vim syntax highlighting
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ in {
|
||||||
'');
|
'');
|
||||||
|
|
||||||
pluginRC.treesitter = entryAfter ["basic"] ''
|
pluginRC.treesitter = entryAfter ["basic"] ''
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter').setup {
|
||||||
-- Disable imperative treesitter options that would attempt to fetch
|
-- Disable imperative treesitter options that would attempt to fetch
|
||||||
-- grammars into the read-only Nix store. To add additional grammars here
|
-- grammars into the read-only Nix store. To add additional grammars here
|
||||||
-- you must use the `config.vim.treesitter.grammars` option.
|
-- you must use the `config.vim.treesitter.grammars` option.
|
||||||
|
|
|
||||||
|
|
@ -25,14 +25,14 @@ in {
|
||||||
type = listOf package;
|
type = listOf package;
|
||||||
default = [];
|
default = [];
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
with pkgs.vimPlugins.nvim-treesitter.grammarPlugins; [
|
||||||
regex
|
regex
|
||||||
kdl
|
kdl
|
||||||
];
|
];
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
List of treesitter grammars to install. For grammars to be installed properly,
|
List of treesitter grammars to install. For grammars to be installed properly,
|
||||||
you must use grammars from `pkgs.vimPlugins.nvim-treesitter.builtGrammars`.
|
you must use grammars from `pkgs.vimPlugins.nvim-treesitter.grammarPlugins`.
|
||||||
You can use `pkgs.vimPlugins.nvim-treesitter.allGrammars` to install all grammars.
|
You can use `pkgs.vimPlugins.nvim-treesitter.allGrammars` to install all grammars.
|
||||||
|
|
||||||
For languages already supported by nvf, you may use
|
For languages already supported by nvf, you may use
|
||||||
|
|
@ -56,7 +56,7 @@ in {
|
||||||
internal = true;
|
internal = true;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
type = listOf package;
|
type = listOf package;
|
||||||
default = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [c lua vim vimdoc query];
|
default = with pkgs.vimPlugins.nvim-treesitter.grammarPlugins; [c lua vim vimdoc query];
|
||||||
description = ''
|
description = ''
|
||||||
A list of treesitter grammars that will be installed by default
|
A list of treesitter grammars that will be installed by default
|
||||||
if treesitter has been enabled and {option}`vim.treeesitter.addDefaultGrammars`
|
if treesitter has been enabled and {option}`vim.treeesitter.addDefaultGrammars`
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ in {
|
||||||
|
|
||||||
# set up treesitter-textobjects after Treesitter, whose config we're adding to.
|
# set up treesitter-textobjects after Treesitter, whose config we're adding to.
|
||||||
pluginRC.treesitter-textobjects = entryAfter ["treesitter"] ''
|
pluginRC.treesitter-textobjects = entryAfter ["treesitter"] ''
|
||||||
require("nvim-treesitter.configs").setup({textobjects = ${toLuaObject cfg.setupOpts}})
|
require("nvim-treesitter").setup({textobjects = ${toLuaObject cfg.setupOpts}})
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
cfg = config.vim.ui.noice;
|
cfg = config.vim.ui.noice;
|
||||||
tscfg = config.vim.treesitter;
|
tscfg = config.vim.treesitter;
|
||||||
|
|
||||||
defaultGrammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [vim regex lua bash markdown];
|
defaultGrammars = with pkgs.vimPlugins.nvim-treesitter.grammarPlugins; [vim regex lua bash markdown];
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue