mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-17 17:31:18 +00:00
visuals: move nvim-cursorline to its own module; switch to setupOpts
This commit is contained in:
parent
47b5d51f5c
commit
db54345de1
7 changed files with 78 additions and 29 deletions
21
modules/plugins/visuals/nvim-cursorline/config.nix
Normal file
21
modules/plugins/visuals/nvim-cursorline/config.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.visuals.cursorline;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["nvim-cursorline"];
|
||||
|
||||
pluginRC.cursorline = entryAnywhere ''
|
||||
require("nvim-cursorline").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
6
modules/plugins/visuals/nvim-cursorline/default.nix
Normal file
6
modules/plugins/visuals/nvim-cursorline/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./nvim-cursorline.nix
|
||||
];
|
||||
}
|
||||
49
modules/plugins/visuals/nvim-cursorline/nvim-cursorline.nix
Normal file
49
modules/plugins/visuals/nvim-cursorline/nvim-cursorline.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.modules) mkRenamedOptionModule mkRemovedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) int bool;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
imports = [
|
||||
(mkRenamedOptionModule ["vim" "visuals" "cursorline" "lineTimeout"] ["vim" "visuals" "cursorline" "setupOpts" "line_timeout"])
|
||||
(mkRemovedOptionModule ["vim" "visuals" "cursorline" "lineNumbersOnly"] ''
|
||||
`vim.visuals.cursorline.lineNumbersOnly` has been removed. Use `vim.visuals.cursorline.number` instead.
|
||||
'')
|
||||
];
|
||||
|
||||
options.vim.visuals.cursorline = {
|
||||
enable = mkEnableOption "cursor word and line highlighting [nvim-cursorline]";
|
||||
setupOpts = mkPluginSetupOption "cursorline" {
|
||||
cursorline = {
|
||||
enable = mkEnableOption "cursor line highlighting";
|
||||
timeout = mkOption {
|
||||
type = int;
|
||||
default = 1000;
|
||||
};
|
||||
|
||||
number = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
cursorword = {
|
||||
enable = mkEnableOption "cursor word highlighting";
|
||||
timeout = mkOption {
|
||||
type = int;
|
||||
default = 1000;
|
||||
};
|
||||
|
||||
min_length = mkOption {
|
||||
type = int;
|
||||
default = 3;
|
||||
};
|
||||
|
||||
hl.underline = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue