|
1 | 1 | {
|
2 | 2 | lib,
|
3 |
| - helpers, |
4 |
| - config, |
5 |
| - pkgs, |
6 | 3 | ...
|
7 | 4 | }:
|
8 |
| -with lib; |
9 | 5 | let
|
10 |
| - cfg = config.plugins.cursorline; |
| 6 | + inherit (lib.nixvim) defaultNullOpts; |
| 7 | + inherit (lib) types; |
11 | 8 | in
|
12 |
| -{ |
13 |
| - options.plugins.cursorline = lib.nixvim.plugins.neovim.extraOptionsOptions // { |
14 |
| - enable = mkEnableOption "nvim-cursorline"; |
15 |
| - |
16 |
| - package = lib.mkPackageOption pkgs "nvim-cursorline" { |
17 |
| - default = [ |
18 |
| - "vimPlugins" |
19 |
| - "nvim-cursorline" |
20 |
| - ]; |
21 |
| - }; |
| 9 | +lib.nixvim.plugins.mkNeovimPlugin { |
| 10 | + name = "cursorline"; |
| 11 | + moduleName = "nvim-cursorline"; |
| 12 | + packPathName = "nvim-cursorline"; |
| 13 | + package = "nvim-cursorline"; |
22 | 14 |
|
23 |
| - cursorline = { |
24 |
| - enable = helpers.defaultNullOpts.mkBool true "Show / hide cursorline in connection with cursor moving."; |
| 15 | + maintainers = [ lib.maintainers.khaneliman ]; |
25 | 16 |
|
26 |
| - timeout = helpers.defaultNullOpts.mkInt 1000 "Time (in ms) after which the cursorline appears."; |
| 17 | + description = '' |
| 18 | + A Neovim plugin to highlight the cursor line and word under the cursor. |
| 19 | + ''; |
27 | 20 |
|
28 |
| - number = helpers.defaultNullOpts.mkBool false "Whether to also highlight the line number."; |
| 21 | + settingsOptions = { |
| 22 | + cursorline = { |
| 23 | + enable = defaultNullOpts.mkBool true "Show / hide cursorline in connection with cursor moving."; |
| 24 | + timeout = defaultNullOpts.mkInt 1000 "Time (in ms) after which the cursorline appears."; |
| 25 | + number = defaultNullOpts.mkBool false "Whether to also highlight the line number."; |
29 | 26 | };
|
30 | 27 | cursorword = {
|
31 |
| - enable = helpers.defaultNullOpts.mkBool true "Underlines the word under the cursor."; |
32 |
| - |
33 |
| - minLength = helpers.defaultNullOpts.mkInt 3 "Minimum length for underlined words."; |
34 |
| - |
35 |
| - hl = helpers.defaultNullOpts.mkAttrsOf types.anything { |
| 28 | + enable = defaultNullOpts.mkBool true "Underlines the word under the cursor."; |
| 29 | + min_length = defaultNullOpts.mkInt 3 "Minimum length for underlined words."; |
| 30 | + hl = defaultNullOpts.mkAttrsOf types.anything { |
36 | 31 | underline = true;
|
37 |
| - } "Highliht definition map for cursorword highlighting."; |
| 32 | + } "Highlight definition map for cursorword highlighting."; |
38 | 33 | };
|
39 | 34 | };
|
40 | 35 |
|
41 |
| - config = |
42 |
| - let |
43 |
| - options = { |
44 |
| - cursorline = with cfg.cursorline; { |
45 |
| - inherit enable timeout number; |
46 |
| - }; |
47 |
| - cursorword = with cfg.cursorword; { |
48 |
| - inherit enable; |
49 |
| - min_length = minLength; |
50 |
| - inherit hl; |
| 36 | + settingsExample = { |
| 37 | + settings = { |
| 38 | + cursorline = { |
| 39 | + enable = true; |
| 40 | + timeout = 1000; |
| 41 | + number = false; |
| 42 | + }; |
| 43 | + cursorword = { |
| 44 | + enable = true; |
| 45 | + min_length = 3; |
| 46 | + hl = { |
| 47 | + underline = true; |
51 | 48 | };
|
52 |
| - } // cfg.extraOptions; |
53 |
| - in |
54 |
| - mkIf cfg.enable { |
55 |
| - extraPlugins = [ cfg.package ]; |
56 |
| - |
57 |
| - extraConfigLua = '' |
58 |
| - require('nvim-cursorline').setup(${lib.nixvim.toLuaObject options}) |
59 |
| - ''; |
| 49 | + }; |
60 | 50 | };
|
| 51 | + }; |
| 52 | + |
| 53 | + # TODO: Deprecated in 2025-02-01 |
| 54 | + inherit (import ./deprecations.nix) deprecateExtraOptions optionsRenamedToSettings; |
61 | 55 | }
|
0 commit comments