nixos: adjust zsh completion setup
This commit is contained in:
@@ -53,6 +53,7 @@ in
|
|||||||
# Shell configuration
|
# Shell configuration
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
enableCompletion = false;
|
||||||
histSize = 10000000;
|
histSize = 10000000;
|
||||||
setOptions = [
|
setOptions = [
|
||||||
"EXTENDED_HISTORY"
|
"EXTENDED_HISTORY"
|
||||||
@@ -71,24 +72,31 @@ in
|
|||||||
plugins = ["git" "sudo" "pip"];
|
plugins = ["git" "sudo" "pip"];
|
||||||
};
|
};
|
||||||
shellInit = ''
|
shellInit = ''
|
||||||
fpath=("${zshLibDir}/completions" $fpath)
|
# The shared editable dotfiles worktree is group-writable, which makes
|
||||||
fpath+="${zshLibDir}/functions"
|
# zsh's compaudit reject our local fpath entries. Completion loading is
|
||||||
for file in "${zshLibDir}/functions/"*(N)
|
# handled once by oh-my-zsh below, with this check intentionally skipped.
|
||||||
|
ZSH_DISABLE_COMPFIX=true
|
||||||
|
|
||||||
|
fpath=("$HOME/.lib/completions" "${libDir}/completions" $fpath)
|
||||||
|
fpath+="${libDir}/functions"
|
||||||
|
for file in "${libDir}/functions/"*
|
||||||
do
|
do
|
||||||
autoload "''${file##*/}"
|
autoload "''${file##*/}"
|
||||||
done
|
done
|
||||||
fpath+="${pkgs.python-with-my-packages}/lib/python3.11/site-packages/argcomplete/bash_completion.d"
|
fpath+="${pkgs.python-with-my-packages}/lib/python3.11/site-packages/argcomplete/bash_completion.d"
|
||||||
'';
|
'';
|
||||||
interactiveShellInit = ''
|
interactiveShellInit = ''
|
||||||
eval "$(register-python-argcomplete prb)"
|
|
||||||
eval "$(register-python-argcomplete prod-prb)"
|
|
||||||
eval "$(register-python-argcomplete railbird)"
|
|
||||||
[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/zsh"
|
[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/zsh"
|
||||||
|
|
||||||
# Enable bracketed paste
|
# Enable bracketed paste
|
||||||
autoload -Uz bracketed-paste-magic
|
autoload -Uz bracketed-paste-magic
|
||||||
zle -N bracketed-paste bracketed-paste-magic
|
zle -N bracketed-paste bracketed-paste-magic
|
||||||
'';
|
'';
|
||||||
|
promptInit = lib.mkBefore ''
|
||||||
|
eval "$(register-python-argcomplete prb)"
|
||||||
|
eval "$(register-python-argcomplete prod-prb)"
|
||||||
|
eval "$(register-python-argcomplete railbird)"
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
|
|||||||
Reference in New Issue
Block a user