mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-09 03:56:11 +00:00
Generated using:
- `sd -F "inherit (lib.nvim.binds) mkMappingOption;" "inherit (config.vim.lib) mkMappingOption;" $(find . -type f)`
- `sd -F "{lib, ...}: let" "{config, lib, ...}: let" $(find . -type f)`
Tweaked manually (placement in inherit list, fixing todo-comments and toggleterm).
Ran `nix run nixpkgs#deadnix -- -e` to clean up.
Next commit includes unrelated dead code.
62 lines
1.9 KiB
Nix
62 lines
1.9 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkRenamedOptionModule;
|
|
inherit (lib.options) mkOption mkEnableOption;
|
|
inherit (lib.types) str listOf;
|
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
|
inherit (config.vim.lib) mkMappingOption;
|
|
in {
|
|
imports = let
|
|
renamedSetupOption = oldPath: newPath:
|
|
mkRenamedOptionModule
|
|
(["vim" "notes" "todo-comments"] ++ oldPath)
|
|
(["vim" "notes" "todo-comments" "setupOpts"] ++ newPath);
|
|
in [
|
|
(renamedSetupOption ["patterns" "highlight"] ["highlight" "pattern"])
|
|
(renamedSetupOption ["patterns" "search"] ["search" "pattern"])
|
|
];
|
|
|
|
options.vim.notes.todo-comments = {
|
|
enable = mkEnableOption "todo-comments: highlight and search for todo comments like TODO, HACK, BUG in your code base";
|
|
|
|
setupOpts = mkPluginSetupOption "todo-comments.nvim" {
|
|
highlight = {
|
|
pattern = mkOption {
|
|
type = str;
|
|
default = ''.*<(KEYWORDS)(\([^\)]*\))?:'';
|
|
description = "vim regex pattern used for highlighting comments";
|
|
};
|
|
};
|
|
|
|
search = {
|
|
pattern = mkOption {
|
|
type = str;
|
|
default = ''\b(KEYWORDS)(\([^\)]*\))?:'';
|
|
description = "ripgrep regex pattern used for searching comments";
|
|
};
|
|
|
|
command = mkOption {
|
|
type = str;
|
|
default = "${pkgs.ripgrep}/bin/rg";
|
|
description = "search command";
|
|
};
|
|
|
|
args = mkOption {
|
|
type = listOf str;
|
|
default = ["--color=never" "--no-heading" "--with-filename" "--line-number" "--column"];
|
|
description = "arguments to pass to the search command";
|
|
};
|
|
};
|
|
};
|
|
|
|
mappings = {
|
|
quickFix = mkMappingOption "Open Todo-s in a quickfix list" "<leader>tdq";
|
|
telescope = mkMappingOption "Open Todo-s in telescope" "<leader>tds";
|
|
trouble = mkMappingOption "Open Todo-s in Trouble" "<leader>tdt";
|
|
};
|
|
};
|
|
}
|