home: firefox: tridactyl: refactor vim command

Thus far, I've only encountered `termite` having a broken implementation
of `--exec`...
This commit is contained in:
Bruno BELANYI 2026-03-19 19:59:23 +00:00
parent 6a7037f2a6
commit 70f651c5fa

View file

@ -4,11 +4,19 @@ let
term = config.my.home.terminal.default;
vimCommandLine = {
alacritty = ''-e "vim" "%f" "+normal!%lGzv%c|"'';
vimCommandLine =
let
# Termite wants the whole command in a single argument...
termite = ''-e "vim %f '+normal!%lGzv%c|'"'';
brokenExecCommand = {
termite = true;
};
# Assume most other terminals are sane and not broken...
isBroken = brokenExecCommand.${term} or false;
in
if isBroken then
''-e "vim %f '+normal!%lGzv%c|'"''
else
''-e "vim" "%f" "+normal!%lGzv%c|"'';
in
{
config = lib.mkIf cfg.enable {
@ -19,7 +27,7 @@ in
# Make it easy to pick out with a window class name
"--class tridactyl_editor"
# Open vim with the cursor in the correct position
vimCommandLine.${term}
vimCommandLine
];
};
};