34 lines
814 B
Nix
34 lines
814 B
Nix
|
{ config, lib, ... }:
|
||
|
|
||
|
{
|
||
|
options.vim = with lib; with types; {
|
||
|
g = mkOption {
|
||
|
type = attrsOf (oneOf [ str bool number ]);
|
||
|
};
|
||
|
opt = mkOption {
|
||
|
type = attrsOf anything;
|
||
|
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}"));
|
||
|
};
|
||
|
}
|