feat(jujutsu): enable jujutsu shell autocompletion
This commit is contained in:
@@ -40,6 +40,12 @@ in {
|
|||||||
enable = mkEnableOption "Enables jj-cz";
|
enable = mkEnableOption "Enables jj-cz";
|
||||||
alias = mkEnableOption "Enable `jj cz` as an alias to `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 {
|
config = mkIf cfg.enable {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ in {
|
|||||||
concatLines
|
concatLines
|
||||||
[
|
[
|
||||||
(strings.optionalString cfg.eatIntegration ''[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/bash"'')
|
(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
|
cfg.bashrcExtra
|
||||||
];
|
];
|
||||||
enableCompletion = cfg.autocompletion;
|
enableCompletion = cfg.autocompletion;
|
||||||
|
|||||||
@@ -97,15 +97,15 @@ in {
|
|||||||
config.home.shell = {
|
config.home.shell = {
|
||||||
enableShellIntegration = cfg.bash.enable or cfg.zsh.enable or cfg.fish.enable;
|
enableShellIntegration = cfg.bash.enable or cfg.zsh.enable or cfg.fish.enable;
|
||||||
bash = {
|
bash = {
|
||||||
aliases = cfg.aliases // defaultAliases;
|
aliases = defaultAliases // cfg.aliases;
|
||||||
enable = mkDefault cfg.fullDesktop;
|
enable = mkDefault cfg.fullDesktop;
|
||||||
};
|
};
|
||||||
fish = {
|
fish = {
|
||||||
abbrs = cfg.aliases // defaultAliases;
|
abbrs = defaultAliases // cfg.aliases;
|
||||||
enable = mkDefault cfg.fullDesktop;
|
enable = mkDefault cfg.fullDesktop;
|
||||||
};
|
};
|
||||||
zsh = {
|
zsh = {
|
||||||
abbrs = cfg.aliases // defaultAliases;
|
abbrs = defaultAliases // cfg.aliases;
|
||||||
enable = mkDefault cfg.fullDesktop;
|
enable = mkDefault cfg.fullDesktop;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ in {
|
|||||||
__fish_default_command_not_found_handler $argv
|
__fish_default_command_not_found_handler $argv
|
||||||
end
|
end
|
||||||
''
|
''
|
||||||
|
(strings.optionalString config.home.dev.vcs.jj.shellCompletion "jj util completion fish | source")
|
||||||
cfg.extraShellInit
|
cfg.extraShellInit
|
||||||
];
|
];
|
||||||
plugins = [
|
plugins = [
|
||||||
|
|||||||
@@ -62,6 +62,11 @@ in {
|
|||||||
zstyle ':fzf-tab:complete:cd:*' fzf-preview '${pkgs.eza}/bin/eza $realpath'
|
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 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
|
cfg.zshrcExtra
|
||||||
];
|
];
|
||||||
oh-my-zsh = {
|
oh-my-zsh = {
|
||||||
|
|||||||
Reference in New Issue
Block a user