Add prompt option for ed
Ed has the ability to have a prompt, which is nice to see when you are
in command mode. This commit lets you set one via chimera options
Change-Id: I537d686bb866bc6e996446c0251fad8bb09d3c5b
Reviewed-on: https://git.clicks.codes/c/Chimera/NixFiles/+/393
Reviewed-by: Samuel Shuert <coded@clicks.codes>
Tested-by: Skyler Grey <minion@clicks.codes>
diff --git a/homes/x86_64-linux/minion@greylag/default.nix b/homes/x86_64-linux/minion@greylag/default.nix
index 54168a7..9a53e04 100644
--- a/homes/x86_64-linux/minion@greylag/default.nix
+++ b/homes/x86_64-linux/minion@greylag/default.nix
@@ -73,6 +73,7 @@
theme.font.nerdFontGlyphs.enable = true;
editor.ed.enable = true;
+ editor.ed.prompt = ":";
editor.neovim.enable = true;
editor.emacs.enable = true;
editor.neovim.defaultEditor = false;
diff --git a/modules/home/editor/ed/default.nix b/modules/home/editor/ed/default.nix
index 80e4ac6..e7b2b3c 100644
--- a/modules/home/editor/ed/default.nix
+++ b/modules/home/editor/ed/default.nix
@@ -12,13 +12,19 @@
description = "Use Ed as the default editor";
default = true;
};
+ prompt = lib.mkOption {
+ type = lib.types.nullOr lib.types.str;
+ description = "What prompt should show up in command mode?";
+ default = null;
+ example = ":";
+ };
};
config = lib.mkIf config.chimera.editor.ed.enable {
home.packages = [ pkgs.ed ];
home.sessionVariables = lib.mkIf config.chimera.editor.ed.defaultEditor {
- EDITOR = "${pkgs.ed}/bin/ed";
+ EDITOR = "${pkgs.ed}/bin/ed${if config.chimera.editor.ed.prompt != null then " -p '${config.chimera.editor.ed.prompt}'" else ""}";
};
};
}