From d126519514e432799d4734e6d6be30038848b8d5 Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Sun, 6 Aug 2023 22:30:06 -0400 Subject: [PATCH 1/2] fix: cursorline configuration --- configuration.nix | 2 +- modules/visuals/config.nix | 9 +++++++-- modules/visuals/visuals.nix | 12 +++++++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/configuration.nix b/configuration.nix index 718b4d2..98f0b00 100644 --- a/configuration.nix +++ b/configuration.nix @@ -86,7 +86,7 @@ inputs: let eolChar = null; showCurrContext = true; }; - cursorWordline = { + cursorline = { enable = true; lineTimeout = 0; }; diff --git a/modules/visuals/config.nix b/modules/visuals/config.nix index 7910520..703f4dc 100644 --- a/modules/visuals/config.nix +++ b/modules/visuals/config.nix @@ -31,10 +31,15 @@ in { ''; }) - (mkIf cfg.cursorWordline.enable { + (mkIf cfg.cursorline.enable { vim.startPlugins = ["nvim-cursorline"]; vim.luaConfigRC.cursorline = nvim.dag.entryAnywhere '' - vim.g.cursorline_timeout = ${toString cfg.cursorWordline.lineTimeout} + require('nvim-cursorline').setup { + cursorline = { + timeout = ${toString cfg.cursorline.lineTimeout}, + number = ${boolToString (!cfg.cursorline.lineNumbersOnly)}, + } + } ''; }) diff --git a/modules/visuals/visuals.nix b/modules/visuals/visuals.nix index 2a6bf8e..8434093 100644 --- a/modules/visuals/visuals.nix +++ b/modules/visuals/visuals.nix @@ -42,13 +42,19 @@ in { }; }; - cursorWordline = { - enable = mkEnableOption "word and delayed line highlight [nvim-cursorline]."; + cursorline = { + enable = mkEnableOption "Enable line hightlighting on the cursor [nvim-cursorline]"; lineTimeout = mkOption { type = types.int; description = "Time in milliseconds for cursorline to appear"; - default = 500; + default = 0; + }; + + lineNumbersOnly = mkOption { + type = types.bool; + description = "Hightlight only in the presence of line numbers"; + default = true; }; }; From 0a826fb4d36e818d906bc98c89a0a9daee3623d7 Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Mon, 7 Aug 2023 21:32:14 -0400 Subject: [PATCH 2/2] refactor: remove unnecessary word 'enable' from mkEnableOption --- modules/visuals/visuals.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/visuals/visuals.nix b/modules/visuals/visuals.nix index 8434093..cab808e 100644 --- a/modules/visuals/visuals.nix +++ b/modules/visuals/visuals.nix @@ -43,7 +43,7 @@ in { }; cursorline = { - enable = mkEnableOption "Enable line hightlighting on the cursor [nvim-cursorline]"; + enable = mkEnableOption "line hightlighting on the cursor [nvim-cursorline]"; lineTimeout = mkOption { type = types.int;