2024-04-26 02:08:23 +03:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
options.vim = with lib; with types; {
|
|
|
|
g = mkOption {
|
|
|
|
type = attrsOf (oneOf [ str bool number ]);
|
2024-04-27 01:31:49 +03:00
|
|
|
default = { };
|
2024-04-26 02:08:23 +03:00
|
|
|
};
|
|
|
|
opt = mkOption {
|
|
|
|
type = attrsOf anything;
|
2024-04-27 01:31:49 +03:00
|
|
|
default = { };
|
2024-04-26 02:08:23 +03:00
|
|
|
description = ''
|
|
|
|
A special interface |vim.opt| exists for conveniently interacting with list-
|
|
|
|
and map-style option from Lua: It allows accessing them as Lua tables and
|
|
|
|
offers object-oriented method for adding and removing entries.
|
|
|
|
|
|
|
|
`:help vim.opt`
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
# TODO: think more about vim.cmd
|
|
|
|
namedCmd = mkOption {
|
|
|
|
type = attrsOf str;
|
|
|
|
default = { };
|
|
|
|
};
|
|
|
|
cmd = mkOption {
|
|
|
|
type = str;
|
|
|
|
readOnly = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
|
|
|
vim.cmd = lib.concatLines (lib.flip lib.mapAttrsToList config.vim.namedCmd (k: v: "\" ${k}\n${v}"));
|
|
|
|
};
|
|
|
|
}
|