home: firefox: tridactyl: refactor vim command
Thus far, I've only encountered `termite` having a broken implementation of `--exec`...
This commit is contained in:
parent
6a7037f2a6
commit
70f651c5fa
1 changed files with 14 additions and 6 deletions
|
|
@ -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
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue