mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-19 18:31:18 +00:00
treewide: make the entire generated config lua based
This commit is contained in:
parent
b42a98696c
commit
eba3fa831e
17 changed files with 168 additions and 288 deletions
|
|
@ -146,9 +146,4 @@ in {
|
|||
-- SECTION: ${section.name}
|
||||
${section.data}
|
||||
'';
|
||||
|
||||
mkVimrcSection = section: ''
|
||||
" SECTION: ${section.name}
|
||||
${section.data}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,5 @@
|
|||
languages = import ./languages.nix {inherit lib;};
|
||||
lists = import ./lists.nix {inherit lib;};
|
||||
lua = import ./lua.nix {inherit lib;};
|
||||
vim = import ./vim.nix;
|
||||
neovimConfiguration = import ./configuration.nix {inherit inputs lib;};
|
||||
}
|
||||
|
|
|
|||
10
lib/lua.nix
10
lib/lua.nix
|
|
@ -5,16 +5,6 @@
|
|||
inherit (lib.strings) concatStringsSep concatMapStringsSep stringToCharacters concatLines;
|
||||
inherit (lib.trivial) boolToString warn;
|
||||
in rec {
|
||||
wrapLuaConfig = {
|
||||
luaBefore ? "",
|
||||
luaConfig,
|
||||
luaAfter ? "",
|
||||
}: ''
|
||||
lua << EOF
|
||||
${concatLines [luaBefore luaConfig luaAfter]}
|
||||
EOF
|
||||
'';
|
||||
|
||||
# Convert a null value to lua's nil
|
||||
nullString = value:
|
||||
if value == null
|
||||
|
|
|
|||
26
lib/vim.nix
26
lib/vim.nix
|
|
@ -1,26 +0,0 @@
|
|||
let
|
||||
inherit (builtins) isInt isBool toJSON toString;
|
||||
in rec {
|
||||
# yes? no.
|
||||
yesNo = value:
|
||||
if value
|
||||
then "yes"
|
||||
else "no";
|
||||
|
||||
# convert a boolean to a vim compliant boolean string
|
||||
mkVimBool = val:
|
||||
if val
|
||||
then "1"
|
||||
else "0";
|
||||
|
||||
# convert a literal value to a vim compliant value
|
||||
valToVim = val:
|
||||
if (isInt val)
|
||||
then (toString val)
|
||||
else
|
||||
(
|
||||
if (isBool val)
|
||||
then (mkVimBool val)
|
||||
else (toJSON val)
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue