mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-20 02:41:17 +00:00
treewide: cleanup
This commit is contained in:
parent
84fc8eb860
commit
c1f449137f
9 changed files with 220 additions and 197 deletions
26
lib/vim.nix
Normal file
26
lib/vim.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{lib}: let
|
||||
inherit (builtins) isInt isBool toJSON;
|
||||
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 (builtins.toString val)
|
||||
else
|
||||
(
|
||||
if (isBool val)
|
||||
then (mkVimBool val)
|
||||
else (toJSON val)
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue