{ config, pkgs, lib, ... }: let inherit (builtins) attrValues attrNames map mapAttrs concatStringsSep filter; inherit (lib) mkOption types mapAttrsFlatten filterAttrs optionalString getAttrs literalExpression; inherit (lib) nvim; inherit (nvim.lua) toLuaObject; inherit (nvim.vim) valToVim; inherit (nvim.bool) mkBool; inherit (nvim.dag) resolveDag; cfg = config.vim; wrapLuaConfig = luaConfig: '' lua << EOF ${optionalString cfg.enableLuaLoader '' vim.loader.enable() ''} ${luaConfig} EOF ''; # Most of the keybindings code is highly inspired by pta2002/nixvim. Thank you! mapConfigOptions = { silent = mkBool false "Whether this mapping should be silent. Equivalent to adding to a map."; nowait = mkBool false "Whether to wait for extra input on ambiguous mappings. Equivalent to adding to a map."; script = mkBool false "Equivalent to adding