mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-06-20 22:18:02 +02:00
51759: Show alias values in command completions
Show the value of each alias when descriptions are shown. Enabled by default.
This commit is contained in:
parent
1f64d09127
commit
9a5f213573
2 changed files with 11 additions and 2 deletions
|
@ -1,5 +1,8 @@
|
||||||
2023-05-21 Oliver Kiddle <opk@zsh.org>
|
2023-05-21 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
|
* Marlon Richert: 51759: Completion/Zsh/Type/_command_names:
|
||||||
|
Show alias values in command completions
|
||||||
|
|
||||||
* Marlon Richert: 51760: Doc/Zsh/compwid.yo: r and R were listed
|
* Marlon Richert: 51760: Doc/Zsh/compwid.yo: r and R were listed
|
||||||
in the wrong order.
|
in the wrong order.
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
# complete only external commands and executable files. This and a
|
# complete only external commands and executable files. This and a
|
||||||
# `-' as the first argument is then removed from the arguments.
|
# `-' as the first argument is then removed from the arguments.
|
||||||
|
|
||||||
local args defs expl ffilt
|
local args defs expl ffilt verbose
|
||||||
|
|
||||||
zstyle -t ":completion:${curcontext}:commands" rehash && rehash
|
zstyle -t ":completion:${curcontext}:commands" rehash && rehash
|
||||||
|
|
||||||
|
@ -33,13 +33,19 @@ else
|
||||||
defs=( "$defs[@]"
|
defs=( "$defs[@]"
|
||||||
'builtins:builtin command:compadd -Qk builtins'
|
'builtins:builtin command:compadd -Qk builtins'
|
||||||
"functions:shell function:compadd -k 'functions$ffilt'"
|
"functions:shell function:compadd -k 'functions$ffilt'"
|
||||||
'aliases:alias:compadd -Qk aliases'
|
|
||||||
'suffix-aliases:suffix alias:_suffix_alias_files'
|
'suffix-aliases:suffix alias:_suffix_alias_files'
|
||||||
'reserved-words:reserved word:compadd -Qk reswords'
|
'reserved-words:reserved word:compadd -Qk reswords'
|
||||||
'jobs:: _jobs -t'
|
'jobs:: _jobs -t'
|
||||||
'parameters:: _parameters -g "^*(readonly|association)*" -qS= -r "\n\t\- =[+"'
|
'parameters:: _parameters -g "^*(readonly|association)*" -qS= -r "\n\t\- =[+"'
|
||||||
'parameters:: _parameters -g "*association*~*readonly*" -qS\[ -r "\n\t\- =[+"'
|
'parameters:: _parameters -g "*association*~*readonly*" -qS\[ -r "\n\t\- =[+"'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if zstyle -T ":completion:${curcontext}:aliases" verbose; then
|
||||||
|
printf -v verbose %s:%s\ ${(@q+)${(kv)aliases}[@]//\:/\\:}
|
||||||
|
defs+=( "aliases:alias:(( $verbose ))" )
|
||||||
|
else
|
||||||
|
defs+=( 'aliases:alias:compadd -Qk aliases' )
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
args=( "$@" )
|
args=( "$@" )
|
||||||
|
|
Loading…
Reference in a new issue