2023-02-01 19:11:37 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-07 00:50:27 +00:00
|
|
|
}: let
|
2024-03-24 00:14:39 +00:00
|
|
|
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
2024-07-12 15:47:33 +00:00
|
|
|
inherit (lib.types) int bool str nullOr either listOf attrsOf;
|
2024-03-24 00:14:39 +00:00
|
|
|
inherit (lib.nvim.binds) mkMappingOption;
|
2023-11-07 00:50:27 +00:00
|
|
|
|
2023-04-17 23:34:41 +00:00
|
|
|
cfg = config.vim.visuals;
|
|
|
|
in {
|
2023-02-01 19:11:37 +00:00
|
|
|
options.vim.visuals = {
|
2023-04-17 23:17:36 +00:00
|
|
|
enable = mkEnableOption "Visual enhancements.";
|
2023-02-01 19:11:37 +00:00
|
|
|
|
2023-04-17 23:17:36 +00:00
|
|
|
nvimWebDevicons.enable = mkEnableOption "dev icons. Required for certain plugins [nvim-web-devicons].";
|
2023-02-01 19:11:37 +00:00
|
|
|
|
2023-10-21 17:15:36 +00:00
|
|
|
scrollBar.enable = mkEnableOption "scrollbar [scrollbar.nvim]";
|
2023-02-03 19:53:38 +00:00
|
|
|
|
2023-10-21 17:15:36 +00:00
|
|
|
smoothScroll.enable = mkEnableOption "smooth scrolling [cinnamon-nvim]";
|
2023-02-03 21:20:20 +00:00
|
|
|
|
2023-04-15 13:35:34 +00:00
|
|
|
cellularAutomaton = {
|
2023-10-21 17:15:36 +00:00
|
|
|
enable = mkEnableOption "cellular automaton [cellular-automaton]";
|
2023-04-15 13:35:34 +00:00
|
|
|
|
|
|
|
mappings = {
|
|
|
|
makeItRain = mkMappingOption "Make it rain [cellular-automaton]" "<leader>fml";
|
|
|
|
};
|
2023-02-05 13:14:25 +00:00
|
|
|
};
|
|
|
|
|
2023-08-07 02:30:06 +00:00
|
|
|
cursorline = {
|
2023-08-08 01:32:14 +00:00
|
|
|
enable = mkEnableOption "line hightlighting on the cursor [nvim-cursorline]";
|
2023-02-01 19:11:37 +00:00
|
|
|
|
|
|
|
lineTimeout = mkOption {
|
2024-03-24 00:14:39 +00:00
|
|
|
type = int;
|
2023-04-02 16:58:57 +00:00
|
|
|
description = "Time in milliseconds for cursorline to appear";
|
2023-08-07 02:30:06 +00:00
|
|
|
default = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
lineNumbersOnly = mkOption {
|
2024-03-24 00:14:39 +00:00
|
|
|
type = bool;
|
2023-08-07 02:30:06 +00:00
|
|
|
description = "Hightlight only in the presence of line numbers";
|
|
|
|
default = true;
|
2023-02-01 19:11:37 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
indentBlankline = {
|
2023-10-21 17:15:36 +00:00
|
|
|
enable = mkEnableOption "indentation guides [indent-blankline]";
|
2023-10-14 11:04:48 +00:00
|
|
|
|
2024-07-12 15:47:33 +00:00
|
|
|
setupOpts = {
|
|
|
|
debounce = mkOption {
|
2024-03-24 00:14:39 +00:00
|
|
|
type = int;
|
2024-07-12 15:47:33 +00:00
|
|
|
description = "Debounce time in milliseconds";
|
|
|
|
default = 200;
|
2023-10-14 11:04:48 +00:00
|
|
|
};
|
|
|
|
|
2024-07-12 15:47:33 +00:00
|
|
|
viewport_buffer = {
|
|
|
|
min = mkOption {
|
|
|
|
type = int;
|
|
|
|
description = "Number of lines above and below of what is currently
|
2023-10-14 11:04:48 +00:00
|
|
|
visible in the window";
|
2024-07-12 15:47:33 +00:00
|
|
|
default = 30;
|
|
|
|
};
|
2023-10-14 11:04:48 +00:00
|
|
|
|
2024-07-12 15:47:33 +00:00
|
|
|
max = mkOption {
|
|
|
|
type = int;
|
|
|
|
description = "Number of lines above and below of what is currently
|
|
|
|
visible in the window";
|
|
|
|
default = 500;
|
|
|
|
};
|
2023-10-14 11:04:48 +00:00
|
|
|
};
|
2023-02-01 19:11:37 +00:00
|
|
|
|
2024-07-12 15:47:33 +00:00
|
|
|
indent = {
|
|
|
|
char = mkOption {
|
|
|
|
type = either str (listOf str);
|
|
|
|
description = "Character(s) for indentation guide";
|
|
|
|
default = "│";
|
|
|
|
};
|
2023-02-01 19:11:37 +00:00
|
|
|
|
2024-07-12 15:47:33 +00:00
|
|
|
tab_char = mkOption {
|
|
|
|
type = nullOr (either str (listOf str));
|
|
|
|
description = ''
|
|
|
|
Character(s) for tab indentation guide.
|
2023-02-01 19:11:37 +00:00
|
|
|
|
2024-07-12 15:47:33 +00:00
|
|
|
See `:help ibl.config.indent.tab_char`.
|
|
|
|
'';
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
|
|
|
|
highlight = mkOption {
|
|
|
|
type = nullOr (either str (listOf str));
|
|
|
|
description = ''
|
|
|
|
The highlight group(s) applied to the indentation guide.
|
|
|
|
|
|
|
|
See `:help ibl.config.indent.highlight`.
|
|
|
|
'';
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
|
|
|
|
smart_indent_cap = mkOption {
|
|
|
|
type = bool;
|
|
|
|
description = "Caps the number of indentation levels based on surrounding code";
|
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
priority = mkOption {
|
|
|
|
type = int;
|
|
|
|
description = "Virtual text priority for the indentation guide";
|
|
|
|
default = 1;
|
|
|
|
};
|
2023-02-01 19:11:37 +00:00
|
|
|
|
2024-07-12 15:47:33 +00:00
|
|
|
repeat_linebreak = mkOption {
|
|
|
|
type = bool;
|
|
|
|
description = "Repeat indentation guides on wrapped lines";
|
|
|
|
default = true;
|
|
|
|
};
|
2023-11-24 09:05:19 +00:00
|
|
|
};
|
|
|
|
|
2024-07-12 15:47:33 +00:00
|
|
|
whitespace = {
|
|
|
|
highlight = mkOption {
|
|
|
|
type = nullOr (either str (listOf str));
|
|
|
|
description = ''
|
|
|
|
The highlight group(s) applied to whitespace.
|
|
|
|
|
|
|
|
See `:help ibl.config.whitespace.highlight`.
|
|
|
|
'';
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
|
|
|
|
remove_blankline_trail = mkOption {
|
|
|
|
type = bool;
|
|
|
|
description = "Remove trailing whitespace on blanklines";
|
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
scope = {
|
|
|
|
enabled = mkOption {
|
|
|
|
description = "Highlight current scope from treesitter";
|
|
|
|
type = bool;
|
|
|
|
default = config.vim.treesitter.enable;
|
|
|
|
defaultText = literalExpression "config.vim.treesitter.enable";
|
|
|
|
};
|
|
|
|
|
|
|
|
char = mkOption {
|
|
|
|
type = either str (listOf str);
|
|
|
|
description = "The character(s) for the scope indentation guide";
|
|
|
|
default = cfg.indentBlankline.setupOpts.indent.char;
|
|
|
|
defaultText = literalExpression "config.vim.visuals.indentBlankline.setuopOpts.indent.char";
|
|
|
|
};
|
|
|
|
|
|
|
|
show_start = mkOption {
|
|
|
|
type = bool;
|
|
|
|
description = "Show an underline on the first line of the scope";
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
show_end = mkOption {
|
|
|
|
type = bool;
|
|
|
|
description = "Show an underline on the last line of the scope";
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
show_exact_scope = mkOption {
|
|
|
|
type = bool;
|
|
|
|
description = "Show the scope underline at the exact start of the scope, even if that's to the right of the indentation guide";
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
injected_languages = mkOption {
|
|
|
|
type = bool;
|
|
|
|
description = "Check for injected languages (treesitter)";
|
|
|
|
default = config.vim.treesitter.enable;
|
|
|
|
defaultText = literalExpression "config.vim.treesitter.enable";
|
|
|
|
};
|
|
|
|
|
|
|
|
highlight = mkOption {
|
|
|
|
type = nullOr (either str (listOf str));
|
|
|
|
description = ''
|
|
|
|
The highlight group(s) applied to the scope.
|
|
|
|
|
|
|
|
See `:help `ibl.config.scope.highlight`.
|
|
|
|
'';
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
|
|
|
|
priority = mkOption {
|
|
|
|
type = int;
|
|
|
|
description = "Virtual text priority for the scope";
|
|
|
|
default = 1024;
|
|
|
|
};
|
|
|
|
|
|
|
|
include.node_type = mkOption {
|
|
|
|
type = attrsOf (listOf str);
|
|
|
|
description = "Additional nodes to be used for scope checking, per language";
|
|
|
|
default = {};
|
|
|
|
};
|
|
|
|
|
|
|
|
exclude = {
|
|
|
|
language = mkOption {
|
|
|
|
type = listOf str;
|
|
|
|
description = ''
|
|
|
|
The list of treesitter languages to disable scope for.
|
|
|
|
|
|
|
|
`*` can be used as a wildcard for every language/node type.
|
|
|
|
'';
|
|
|
|
default = [];
|
|
|
|
};
|
|
|
|
|
|
|
|
node_type = mkOption {
|
|
|
|
type = attrsOf (listOf str);
|
|
|
|
description = ''
|
|
|
|
Nodes to ignore in scope checking, per language.
|
|
|
|
|
|
|
|
`*` can be used as a wildcard for every language.
|
|
|
|
'';
|
|
|
|
default = {
|
|
|
|
"*" = ["source_file" "program"];
|
|
|
|
lua = ["chunk"];
|
|
|
|
python = ["module"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-10-14 11:04:48 +00:00
|
|
|
};
|
2023-02-01 19:11:37 +00:00
|
|
|
};
|
|
|
|
};
|
2023-10-21 22:22:31 +00:00
|
|
|
|
|
|
|
highlight-undo = {
|
|
|
|
enable = mkEnableOption "highlight undo [highlight-undo]";
|
|
|
|
|
|
|
|
highlightForCount = mkOption {
|
2024-03-24 00:14:39 +00:00
|
|
|
type = bool;
|
2023-10-21 22:22:31 +00:00
|
|
|
default = true;
|
2023-11-04 11:30:04 +00:00
|
|
|
description = ''
|
2023-10-21 22:54:56 +00:00
|
|
|
Enable support for highlighting when a <count> is provided before the key
|
|
|
|
If set to false it will only highlight when the mapping is not prefixed with a <count>
|
2023-10-21 22:22:31 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
duration = mkOption {
|
2024-03-24 00:14:39 +00:00
|
|
|
type = int;
|
2023-10-21 22:22:31 +00:00
|
|
|
description = "Duration of highlight";
|
2023-10-23 17:15:31 +00:00
|
|
|
default = 500;
|
2023-10-21 22:22:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
undo = {
|
|
|
|
hlGroup = mkOption {
|
2024-03-24 00:14:39 +00:00
|
|
|
type = str;
|
2023-10-21 22:22:31 +00:00
|
|
|
description = "Highlight group for undo";
|
|
|
|
default = "HighlightUndo";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
redo = {
|
|
|
|
hlGroup = mkOption {
|
2024-03-24 00:14:39 +00:00
|
|
|
type = str;
|
2023-10-21 22:22:31 +00:00
|
|
|
description = "Highlight group for redo";
|
|
|
|
default = "HighlightUndo";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-02-01 19:11:37 +00:00
|
|
|
};
|
|
|
|
}
|