added formatter + reformat existing codebase (#175)

This commit is contained in:
Gaétan Lepage 2023-02-20 11:42:13 +01:00 committed by GitHub
parent 0bf4313f22
commit 264de8cefb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
96 changed files with 3727 additions and 3341 deletions

View file

@ -1,44 +1,48 @@
{ config, lib, ... }:
with lib;
let
helpers = import ../lib/helpers.nix { inherit lib; };
in
{
config,
lib,
...
}:
with lib; let
helpers = import ../lib/helpers.nix {inherit lib;};
in {
options = {
options = mkOption {
type = types.attrsOf types.anything;
default = { };
default = {};
description = "The configuration options, e.g. line numbers";
};
globals = mkOption {
type = types.attrsOf types.anything;
default = { };
default = {};
description = "Global variables";
};
};
config = {
extraConfigLuaPre = optionalString (config.globals != { }) ''
-- Set up globals {{{
do
local nixvim_globals = ${helpers.toLuaObject config.globals}
extraConfigLuaPre =
optionalString (config.globals != {}) ''
-- Set up globals {{{
do
local nixvim_globals = ${helpers.toLuaObject config.globals}
for k,v in pairs(nixvim_globals) do
vim.g[k] = v
for k,v in pairs(nixvim_globals) do
vim.g[k] = v
end
end
end
-- }}}
'' + optionalString (config.options != { }) ''
-- Set up options {{{
do
local nixvim_options = ${helpers.toLuaObject config.options}
-- }}}
''
+ optionalString (config.options != {}) ''
-- Set up options {{{
do
local nixvim_options = ${helpers.toLuaObject config.options}
for k,v in pairs(nixvim_options) do
vim.opt[k] = v
for k,v in pairs(nixvim_options) do
vim.opt[k] = v
end
end
end
-- }}}
'';
-- }}}
'';
};
}