mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-19 15:39:49 +01:00
Merge pull request #154 from NotAShelf/feat/bump-ibl
modules/visuals: update indent-blankline to v3
This commit is contained in:
commit
712b8a8e93
5 changed files with 77 additions and 35 deletions
|
@ -89,7 +89,9 @@ inputs: let
|
||||||
enable = true;
|
enable = true;
|
||||||
fillChar = null;
|
fillChar = null;
|
||||||
eolChar = null;
|
eolChar = null;
|
||||||
showCurrContext = true;
|
scope = {
|
||||||
|
enabled = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
cursorline = {
|
cursorline = {
|
||||||
|
|
|
@ -78,6 +78,8 @@ https://github.com/notashelf[notashelf]:
|
||||||
To quote home-manager commit: "Output is mostly unchanged aside from some minor typographical and
|
To quote home-manager commit: "Output is mostly unchanged aside from some minor typographical and
|
||||||
formatting changes, along with better source links."
|
formatting changes, along with better source links."
|
||||||
|
|
||||||
|
* Updated indent-blankine.nvim to v3 - this comes with a few option changes, which will be migrated with `renamedOptionModule`
|
||||||
|
|
||||||
|
|
||||||
https://github.com/jacekpoz[jacekpoz]:
|
https://github.com/jacekpoz[jacekpoz]:
|
||||||
|
|
||||||
|
|
12
flake.lock
12
flake.lock
|
@ -35,11 +35,11 @@
|
||||||
"catppuccin": {
|
"catppuccin": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1690630440,
|
"lastModified": 1700667946,
|
||||||
"narHash": "sha256-MSZcIrV3vvgb5mlMpO5uRlAYoENm2pZyuZbV5Q9Vg58=",
|
"narHash": "sha256-TBOaD7A8/c/sg78C1hUpPDuIrrQkSUQR1KgHiDb6jxs=",
|
||||||
"owner": "catppuccin",
|
"owner": "catppuccin",
|
||||||
"repo": "nvim",
|
"repo": "nvim",
|
||||||
"rev": "057c34f849cf21059487d849e2f3b3efcd4ee0eb",
|
"rev": "a2107df4379d66e72a36a89792603151cebec1bf",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -584,11 +584,11 @@
|
||||||
"indent-blankline": {
|
"indent-blankline": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1688727830,
|
"lastModified": 1697081010,
|
||||||
"narHash": "sha256-efMRkxjbr6o7kSKAEn0Kaw8lsDubRmc1N0Kd1BZ3A7k=",
|
"narHash": "sha256-e8gn4pJYALaQ6sGA66SFf8p6VLJBPxT/BimQhOd5eBs=",
|
||||||
"owner": "lukas-reineke",
|
"owner": "lukas-reineke",
|
||||||
"repo": "indent-blankline.nvim",
|
"repo": "indent-blankline.nvim",
|
||||||
"rev": "4541d690816cb99a7fc248f1486aa87f3abce91c",
|
"rev": "0fe34b4c1b926e106d105d3ae88ef6cbf6743572",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -12,7 +12,7 @@ in {
|
||||||
vim.startPlugins = ["indent-blankline"];
|
vim.startPlugins = ["indent-blankline"];
|
||||||
vim.luaConfigRC.indent-blankline = nvim.dag.entryAnywhere ''
|
vim.luaConfigRC.indent-blankline = nvim.dag.entryAnywhere ''
|
||||||
-- highlight error: https://github.com/lukas-reineke/indent-blankline.nvim/issues/59
|
-- highlight error: https://github.com/lukas-reineke/indent-blankline.nvim/issues/59
|
||||||
vim.wo.colorcolumn = "99999"
|
-- vim.wo.colorcolumn = "99999"
|
||||||
vim.opt.list = true
|
vim.opt.list = true
|
||||||
|
|
||||||
${optionalString (cfg.indentBlankline.eolChar != null) ''
|
${optionalString (cfg.indentBlankline.eolChar != null) ''
|
||||||
|
@ -22,12 +22,20 @@ in {
|
||||||
vim.opt.listchars:append({ space = "${cfg.indentBlankline.fillChar}" })
|
vim.opt.listchars:append({ space = "${cfg.indentBlankline.fillChar}" })
|
||||||
''}
|
''}
|
||||||
|
|
||||||
require("indent_blankline").setup {
|
require("ibl").setup {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
char = "${cfg.indentBlankline.listChar}",
|
debounce = ${toString cfg.indentBlankline.debounce},
|
||||||
show_current_context = ${boolToString cfg.indentBlankline.showCurrContext},
|
indent = { char = "${cfg.indentBlankline.indent.char}" },
|
||||||
show_end_of_line = ${boolToString cfg.indentBlankline.showEndOfLine},
|
|
||||||
use_treesitter = ${boolToString cfg.indentBlankline.useTreesitter},
|
viewport_buffer = {
|
||||||
|
min = ${toString cfg.indentBlankline.viewportBuffer.min},
|
||||||
|
max = ${toString cfg.indentBlankline.viewportBuffer.max},
|
||||||
|
},
|
||||||
|
|
||||||
|
scope = {
|
||||||
|
enabled = ${boolToString cfg.indentBlankline.scope.enabled},
|
||||||
|
show_end = ${boolToString cfg.indentBlankline.scope.showEndOfLine}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
|
@ -3,10 +3,16 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkEnableOption mkMappingOption mkOption types literalExpression;
|
inherit (lib) mkEnableOption mkMappingOption mkOption types literalExpression mkRenamedOptionModule mkRemovedOptionModule;
|
||||||
|
|
||||||
cfg = config.vim.visuals;
|
cfg = config.vim.visuals;
|
||||||
in {
|
in {
|
||||||
|
imports = [
|
||||||
|
(mkRenamedOptionModule ["vim" "visuals" "indentBlankline" "showCurrContext"] ["vim" "visuals" "indentBlankline" "scope" "enabled"])
|
||||||
|
(mkRenamedOptionModule ["vim" "visuals" "indentBlankline" "showEndOfLine"] ["vim" "visuals" "indentBlankline" "scope" "showEndOfLine"])
|
||||||
|
(mkRemovedOptionModule ["vim" "visuals" "indentBlankline" "useTreesitter"] "`vim.visuals.indentBlankline.useTreesitter` has been removed upstream and can safely be removed from your configuration.")
|
||||||
|
];
|
||||||
|
|
||||||
options.vim.visuals = {
|
options.vim.visuals = {
|
||||||
enable = mkEnableOption "Visual enhancements.";
|
enable = mkEnableOption "Visual enhancements.";
|
||||||
|
|
||||||
|
@ -60,6 +66,35 @@ in {
|
||||||
|
|
||||||
indentBlankline = {
|
indentBlankline = {
|
||||||
enable = mkEnableOption "indentation guides [indent-blankline]";
|
enable = mkEnableOption "indentation guides [indent-blankline]";
|
||||||
|
debounce = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
description = "Debounce time in milliseconds";
|
||||||
|
default = 200;
|
||||||
|
};
|
||||||
|
|
||||||
|
viewportBuffer = {
|
||||||
|
min = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
description = "Number of lines above and below of what is currently
|
||||||
|
visible in the window";
|
||||||
|
default = 30;
|
||||||
|
};
|
||||||
|
|
||||||
|
max = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
description = "Number of lines above and below of what is currently
|
||||||
|
visible in the window";
|
||||||
|
default = 500;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
indent = {
|
||||||
|
char = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "Character for indentation line";
|
||||||
|
default = "│";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
listChar = mkOption {
|
listChar = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
@ -79,6 +114,14 @@ in {
|
||||||
default = "↴";
|
default = "↴";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
scope = {
|
||||||
|
enabled = mkOption {
|
||||||
|
description = "Highlight current scope from treesitter";
|
||||||
|
type = types.bool;
|
||||||
|
default = config.vim.treesitter.enable;
|
||||||
|
defaultText = literalExpression "config.vim.treesitter.enable";
|
||||||
|
};
|
||||||
|
|
||||||
showEndOfLine = mkOption {
|
showEndOfLine = mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
Displays the end of line character set by [](#opt-vim.visuals.indentBlankline.eolChar) instead of the
|
Displays the end of line character set by [](#opt-vim.visuals.indentBlankline.eolChar) instead of the
|
||||||
|
@ -88,19 +131,6 @@ in {
|
||||||
default = cfg.indentBlankline.eolChar != null;
|
default = cfg.indentBlankline.eolChar != null;
|
||||||
defaultText = literalExpression "config.vim.visuals.indentBlankline.eolChar != null";
|
defaultText = literalExpression "config.vim.visuals.indentBlankline.eolChar != null";
|
||||||
};
|
};
|
||||||
|
|
||||||
showCurrContext = mkOption {
|
|
||||||
description = "Highlight current context from treesitter";
|
|
||||||
type = types.bool;
|
|
||||||
default = config.vim.treesitter.enable;
|
|
||||||
defaultText = literalExpression "config.vim.treesitter.enable";
|
|
||||||
};
|
|
||||||
|
|
||||||
useTreesitter = mkOption {
|
|
||||||
description = "Use treesitter to calculate indentation when possible.";
|
|
||||||
type = types.bool;
|
|
||||||
default = config.vim.treesitter.enable;
|
|
||||||
defaultText = literalExpression "config.vim.treesitter.enable";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue