feat(jujutsu): enable jujutsu shell autocompletion

This commit is contained in:
2026-05-24 10:07:24 +02:00
parent 206b170d3e
commit 91dc8e5070
5 changed files with 16 additions and 3 deletions
+6
View File
@@ -40,6 +40,12 @@ in {
enable = mkEnableOption "Enables jj-cz";
alias = mkEnableOption "Enable `jj cz` as an alias to `jj-cz`";
};
# used in my shell .nix files
shellCompletion = mkOption {
description = "Enable Jujutsu shell completion";
type = types.bool;
default = true;
};
};
config = mkIf cfg.enable {
+1
View File
@@ -36,6 +36,7 @@ in {
concatLines
[
(strings.optionalString cfg.eatIntegration ''[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/bash"'')
(strings.optionalString config.home.dev.vcs.jj.shellCompletion "source <(jj util completion bash)")
cfg.bashrcExtra
];
enableCompletion = cfg.autocompletion;
+3 -3
View File
@@ -97,15 +97,15 @@ in {
config.home.shell = {
enableShellIntegration = cfg.bash.enable or cfg.zsh.enable or cfg.fish.enable;
bash = {
aliases = cfg.aliases // defaultAliases;
aliases = defaultAliases // cfg.aliases;
enable = mkDefault cfg.fullDesktop;
};
fish = {
abbrs = cfg.aliases // defaultAliases;
abbrs = defaultAliases // cfg.aliases;
enable = mkDefault cfg.fullDesktop;
};
zsh = {
abbrs = cfg.aliases // defaultAliases;
abbrs = defaultAliases // cfg.aliases;
enable = mkDefault cfg.fullDesktop;
};
};
+1
View File
@@ -41,6 +41,7 @@ in {
__fish_default_command_not_found_handler $argv
end
''
(strings.optionalString config.home.dev.vcs.jj.shellCompletion "jj util completion fish | source")
cfg.extraShellInit
];
plugins = [
+5
View File
@@ -62,6 +62,11 @@ in {
zstyle ':fzf-tab:complete:cd:*' fzf-preview '${pkgs.eza}/bin/eza $realpath'
''
(strings.optionalString cfg.eatIntegration ''[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/zsh"'')
(strings.optionalString config.home.dev.vcs.jj.shellCompletion ''
autoload -U compinit
compinit
source <(jj util completion zsh)
'')
cfg.zshrcExtra
];
oh-my-zsh = {