diff --git a/configuration.nix b/configuration.nix index 9718a4b..86e5faf 100644 --- a/configuration.nix +++ b/configuration.nix @@ -87,7 +87,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..cab808e 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 "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; }; };