diff --git a/lib/autocmd-helpers.nix b/lib/autocmd-helpers.nix index 4d6e7ae8..927fca8c 100644 --- a/lib/autocmd-helpers.nix +++ b/lib/autocmd-helpers.nix @@ -1,6 +1,7 @@ -{ lib, helpers }: +{ lib }: let inherit (lib) types; + inherit (lib.nixvim) defaultNullOpts; in rec { autoGroupOption = types.submodule { @@ -14,34 +15,34 @@ rec { }; autoCmdOptions = { - event = helpers.mkNullOrOption (with types; either str (listOf str)) '' + event = lib.nixvim.mkNullOrOption (with types; either str (listOf str)) '' The event or events to register this autocommand. ''; - group = helpers.mkNullOrOption (with types; either str int) '' + group = lib.nixvim.mkNullOrOption (with types; either str int) '' The autocommand group name or id to match against. ''; - pattern = helpers.mkNullOrOption (with types; either str (listOf str)) '' + pattern = lib.nixvim.mkNullOrOption (with types; either str (listOf str)) '' Pattern or patterns to match literally against. ''; - buffer = helpers.mkNullOrOption types.int '' + buffer = lib.nixvim.mkNullOrOption types.int '' Buffer number for buffer local autocommands |autocmd-buflocal|. Cannot be used with `pattern`. ''; # Introduced early October 2023. # TODO remove in early December 2023. - description = helpers.mkNullOrOption types.str '' + description = lib.nixvim.mkNullOrOption types.str '' DEPRECATED, please use `desc`. ''; - desc = helpers.mkNullOrOption types.str '' + desc = lib.nixvim.mkNullOrOption types.str '' A textual description of this autocommand. ''; - callback = helpers.mkNullOrOption (with types; either str rawLua) '' + callback = lib.nixvim.mkNullOrOption (with types; either str rawLua) '' A function or a string. - if a string, the name of a Vimscript function to call when this autocommand is triggered. - Otherwise, a Lua function which is called when this autocommand is triggered. @@ -65,13 +66,13 @@ rec { } ''; - command = helpers.defaultNullOpts.mkStr "" '' + command = defaultNullOpts.mkStr "" '' Vim command to execute on event. Cannot be used with `callback`. ''; - once = helpers.defaultNullOpts.mkBool false "Run the autocommand only once."; + once = defaultNullOpts.mkBool false "Run the autocommand only once."; - nested = helpers.defaultNullOpts.mkBool false "Run nested autocommands."; + nested = defaultNullOpts.mkBool false "Run nested autocommands."; }; autoCmdOption = types.submodule { options = autoCmdOptions; }; diff --git a/lib/default.nix b/lib/default.nix index abda5dc7..d50b266a 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -4,14 +4,12 @@ _nixvimTests ? false, ... }: -# Build helpers recursively lib.fix ( self: let - # Used when importing parts of helpers + # Used when importing parts of our lib call = lib.callPackageWith { inherit call pkgs self; - helpers = self; # TODO: stop using `helpers` in the subsections lib = self.extendedLib; }; diff --git a/lib/keymap-helpers.nix b/lib/keymap-helpers.nix index 132ca676..daf45705 100644 --- a/lib/keymap-helpers.nix +++ b/lib/keymap-helpers.nix @@ -1,27 +1,28 @@ -{ lib, helpers }: +{ lib }: let inherit (lib) optionalAttrs isAttrs types; + inherit (lib.nixvim) defaultNullOpts; in rec { # These are the configuration options that change the behavior of each mapping. mapConfigOptions = { - silent = helpers.defaultNullOpts.mkBool false "Whether this mapping should be silent. Equivalent to adding `` to a map."; + silent = defaultNullOpts.mkBool false "Whether this mapping should be silent. Equivalent to adding `` to a map."; - nowait = helpers.defaultNullOpts.mkBool false "Whether to wait for extra input on ambiguous mappings. Equivalent to adding `` to a map."; + nowait = defaultNullOpts.mkBool false "Whether to wait for extra input on ambiguous mappings. Equivalent to adding `` to a map."; - script = helpers.defaultNullOpts.mkBool false "Equivalent to adding `