mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-08 12:01:21 +02:00
zsh-workers/9383
This commit is contained in:
parent
aaf6682903
commit
7041116980
3 changed files with 40 additions and 25 deletions
|
@ -18,6 +18,7 @@ styles=(
|
||||||
cursor c:bool
|
cursor c:bool
|
||||||
disable-stat c:bool
|
disable-stat c:bool
|
||||||
expand c:
|
expand c:
|
||||||
|
file-patterns c:
|
||||||
format c:
|
format c:
|
||||||
glob c:
|
glob c:
|
||||||
group-name c:
|
group-name c:
|
||||||
|
@ -49,6 +50,7 @@ styles=(
|
||||||
sort c:bool
|
sort c:bool
|
||||||
tag-order c:tag
|
tag-order c:tag
|
||||||
special-dirs c:sdirs
|
special-dirs c:sdirs
|
||||||
|
squeeze-slashes c:bool
|
||||||
stop c:stop
|
stop c:stop
|
||||||
substitute c:
|
substitute c:
|
||||||
users c:_users
|
users c:_users
|
||||||
|
|
|
@ -157,6 +157,14 @@ if zstyle -s ":completion${curcontext}:files" sort tmp1; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Squeeze sequences of slashes
|
||||||
|
if zstyle -t ":completion${curcontext}:paths" squeeze-slashes
|
||||||
|
then
|
||||||
|
PREFIX="${PREFIX//(\\/)#//}"
|
||||||
|
SUFFIX="${SUFFIX//(\\/)#//}"
|
||||||
|
[[ $PREFIX = */ ]] && SUFFIX=${SUFFIX#/}
|
||||||
|
fi
|
||||||
|
|
||||||
# We get the prefix and the suffix from the line and save the whole
|
# We get the prefix and the suffix from the line and save the whole
|
||||||
# original string. Then we see if we will do menucompletion.
|
# original string. Then we see if we will do menucompletion.
|
||||||
|
|
||||||
|
|
|
@ -1160,6 +1160,36 @@ to tt(menu), then the expansions are only sorted when they are offered
|
||||||
as single strings (not in the string containing all possible
|
as single strings (not in the string containing all possible
|
||||||
expansions).
|
expansions).
|
||||||
)
|
)
|
||||||
|
item(tt(special-dirs))(
|
||||||
|
Normally, the completion code will not produce the directory names
|
||||||
|
tt(.) and tt(..) as possible completions. If this style is set to
|
||||||
|
`true', it will add both `tt(.)' and `tt(..)' as possible completions,
|
||||||
|
if it is set to tt(..), only `tt(..)' will be added.
|
||||||
|
)
|
||||||
|
item(tt(squeeze-slashes))(
|
||||||
|
If set to `true', sequences of slashes (such as tt(foo//bar)) will
|
||||||
|
be rewritten with a single slash (tt(foo/bar)) when completing
|
||||||
|
directory names.
|
||||||
|
)
|
||||||
|
item(tt(stop))(
|
||||||
|
If set to `true', the tt(_history_complete_word) bindable
|
||||||
|
command will always insert matches as if menucompletion were started
|
||||||
|
and it will stop when the last match is inserted. If this style is set
|
||||||
|
to tt(verbose) a message will be displayed when the last match is reached.
|
||||||
|
)
|
||||||
|
item(tt(substitute))(
|
||||||
|
If this is unset or set to the empty string, the tt(_expand) completer
|
||||||
|
will first try to expand all substitutions in the string (such as
|
||||||
|
`tt($LPAR()...RPAR())' and `tt(${...})'). If this is set to an
|
||||||
|
non-empty string it should be an expression usable inside a `tt($((...)))'
|
||||||
|
arithmetical expression. In this case, expansion of substitutions will
|
||||||
|
be done if the expression evaluates to `tt(1)'. For example, with
|
||||||
|
|
||||||
|
example(zstyle ':completion:expand' substitute '${NUMERIC:-1} != 1')
|
||||||
|
|
||||||
|
substitution will be performed only if given an explicit numeric
|
||||||
|
argument other than `tt(1)', as by typing `tt(ESC 2 TAB)'.
|
||||||
|
)
|
||||||
item(tt(tag-order))(
|
item(tt(tag-order))(
|
||||||
This provides a mechanism for sorting how the tags available in a
|
This provides a mechanism for sorting how the tags available in a
|
||||||
particular context will be used.
|
particular context will be used.
|
||||||
|
@ -1196,31 +1226,6 @@ of how such functions can be implemented.
|
||||||
|
|
||||||
If no style has been defined for a context, all tags will be used.
|
If no style has been defined for a context, all tags will be used.
|
||||||
)
|
)
|
||||||
item(tt(special-dirs))(
|
|
||||||
Normally, the completion code will not produce the directory names
|
|
||||||
tt(.) and tt(..) as possible completions. If this style is set to
|
|
||||||
`true', it will add both `tt(.)' and `tt(..)' as possible completions,
|
|
||||||
if it is set to tt(..), only `tt(..)' will be added.
|
|
||||||
)
|
|
||||||
item(tt(stop))(
|
|
||||||
If set to `true', the tt(_history_complete_word) bindable
|
|
||||||
command will always insert matches as if menucompletion were started
|
|
||||||
and it will stop when the last match is inserted. If this style is set
|
|
||||||
to tt(verbose) a message will be displayed when the last match is reached.
|
|
||||||
)
|
|
||||||
item(tt(substitute))(
|
|
||||||
If this is unset or set to the empty string, the tt(_expand) completer
|
|
||||||
will first try to expand all substitutions in the string (such as
|
|
||||||
`tt($LPAR()...RPAR())' and `tt(${...})'). If this is set to an
|
|
||||||
non-empty string it should be an expression usable inside a `tt($((...)))'
|
|
||||||
arithmetical expression. In this case, expansion of substitutions will
|
|
||||||
be done if the expression evaluates to `tt(1)'. For example, with
|
|
||||||
|
|
||||||
example(zstyle ':completion:expand' substitute '${NUMERIC:-1} != 1')
|
|
||||||
|
|
||||||
substitution will be performed only if given an explicit numeric
|
|
||||||
argument other than `tt(1)', as by typing `tt(ESC 2 TAB)'.
|
|
||||||
)
|
|
||||||
item(tt(users))(
|
item(tt(users))(
|
||||||
This may be set to a list of names that should be completed whenever
|
This may be set to a list of names that should be completed whenever
|
||||||
a username is needed. If it is not set or the string on the line
|
a username is needed. If it is not set or the string on the line
|
||||||
|
|
Loading…
Reference in a new issue