feat(visuals): Update and configurations

This commit is contained in:
NotAShelf 2023-04-18 02:17:36 +03:00
parent 8e2ea2bbfc
commit ad95175224
No known key found for this signature in database
GPG Key ID: F0D14CCB5ED5AA22
3 changed files with 34 additions and 25 deletions

View File

@ -68,8 +68,8 @@ inputs: let
fidget-nvim.enable = true;
indentBlankline = {
enable = true;
fillChar = "";
eolChar = "";
fillChar = null;
eolChar = null;
showCurrContext = true;
};
cursorWordline = {

View File

@ -14,17 +14,19 @@ in {
vim.wo.colorcolumn = "99999"
vim.opt.list = true
${optionalString (cfg.indentBlankline.eolChar != "") ''
${optionalString (cfg.indentBlankline.eolChar != null) ''
vim.opt.listchars:append({ eol = "${cfg.indentBlankline.eolChar}" })
''}
${optionalString (cfg.indentBlankline.fillChar != "") ''
vim.opt.listchars:append({ eol = "${cfg.indentBlankline.fillChar}" })
${optionalString (cfg.indentBlankline.fillChar != null) ''
vim.opt.listchars:append({ space = "${cfg.indentBlankline.fillChar}" })
''}
require("indent_blankline").setup {
enabled = true,
char = "${cfg.indentBlankline.listChar}",
show_current_context = ${boolToString cfg.indentBlankline.showCurrContext},
show_end_of_line = true,
show_end_of_line = ${boolToString cfg.indentBlankline.showEndOfLine},
use_treesitter = ${boolToString cfg.indentBlankline.useTreesitter},
}
'';
})

View File

@ -6,17 +6,9 @@
with lib;
with builtins; {
options.vim.visuals = {
enable = mkOption {
type = types.bool;
description = "Enable visual enhancements";
default = false;
};
enable = mkEnableOption "Visual enhancements.";
nvimWebDevicons.enable = mkOption {
type = types.bool;
description = "Enable dev icons. required for certain plugins [nvim-web-devicons]";
default = false;
};
nvimWebDevicons.enable = mkEnableOption "dev icons. Required for certain plugins [nvim-web-devicons].";
scrollBar.enable = mkOption {
type = types.bool;
@ -58,15 +50,12 @@ with builtins; {
};
cursorWordline = {
enable = mkOption {
type = types.bool;
description = "Enable word and delayed line highlight [nvim-cursorline]";
default = false;
};
enable = mkEnableOption "word and delayed line highlight [nvim-cursorline].";
lineTimeout = mkOption {
type = types.int;
description = "Time in milliseconds for cursorline to appear";
default = 500;
};
};
@ -84,21 +73,39 @@ with builtins; {
};
fillChar = mkOption {
type = types.str;
description = "Character to fill indents";
type = with types; nullOr types.str;
default = "";
};
eolChar = mkOption {
type = types.str;
description = "Character at end of line";
type = with types; nullOr types.str;
default = "";
};
showCurrContext = mkOption {
showEndOfLine = mkOption {
description = nvim.nmd.asciiDoc ''
Displays the end of line character set by <<opt-vim.visuals.indentBlankline.eolChar>> instead of the
indent guide on line returns.
'';
type = types.bool;
default = cfg.indentBlankline.eolChar != null;
defaultText = literalExpression "config.vim.visuals.indentBlankline.eolChar != null";
};
showCurrContext = mkOption {
description = "Highlight current context from treesitter";
default = true;
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";
};
};
};