diff options
author | Brahmajit Das <brahmajit.xyz@gmail.com> | 2024-06-17 23:06:28 +0530 |
---|---|---|
committer | Brahmajit Das <brahmajit.xyz@gmail.com> | 2024-06-17 23:06:28 +0530 |
commit | a2961217be50283948ac778aedd386e14227f9d0 (patch) | |
tree | 1a8f95671fb1492490bf4d0d733f958f21b5ec3f | |
parent | b43c3528b8e8cfd50d5ad27b2fc28fe656c389c0 (diff) |
zsh: completion: deprecating rationalise-dot in favor of aliases
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
-rw-r--r-- | .config/zsh/completion.zsh | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/.config/zsh/completion.zsh b/.config/zsh/completion.zsh index 0647b2f..ed57020 100644 --- a/.config/zsh/completion.zsh +++ b/.config/zsh/completion.zsh @@ -59,17 +59,6 @@ zstyle ':completion:*:cd:*' ignore-parents parent pwd ### cd without cd setopt auto_cd -### Quick change directories -rationalise-dot() { - if [[ $LBUFFER = *.. ]]; then - LBUFFER+=/.. - else - LBUFFER+=. - fi -} -zle -N rationalise-dot -bindkey . rationalise-dot - ### Complete from middle of filename zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' '+l:|=* r:|=*' @@ -81,6 +70,19 @@ zstyle ':completion:*' menu select list-colors ${(s.:.)LS_COLORS} ### completion and prompt init autoload -Uz compinit colors vcs_info -fpath+=~/.zfunc +fpath+=(~/.zfunc $fpath) fpath+=(~/.config/zsh/completion $fpath) compinit +__pip() {{ + compadd $( COMP_WORDS="$words[*]" \ + COMP_CWORD=$((CURRENT-1)) \ + PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null ) + }} +if [[ $zsh_eval_context[-1] == loadautofunc ]]; then + # autoload from fpath, call function directly + __pip "$@" +else + # eval/source/. command, register function for later + compdef __pip -P pip + compdef __pip -P pip3 +fi |