mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
prototype of completion for cp and mv
This commit is contained in:
parent
054edc5bd9
commit
df67df476b
@ -29,6 +29,26 @@ EOF
|
|||||||
}
|
}
|
||||||
complete -F _autojump j
|
complete -F _autojump j
|
||||||
|
|
||||||
|
_autojump_files()
|
||||||
|
{
|
||||||
|
if [[ ${COMP_WORDS[COMP_CWORD]} == *__* ]]
|
||||||
|
then
|
||||||
|
local cur
|
||||||
|
#cur=${COMP_WORDS[*]:1}
|
||||||
|
cur=${COMP_WORDS[COMP_CWORD]}
|
||||||
|
comps=$(autojump --bash --completion $cur)
|
||||||
|
while read i
|
||||||
|
do
|
||||||
|
#COMPREPLY=("${COMPREPLY[@]}" "${COMP_WORDS[@]:1:$(( ${#COMP_WORDS[@]} - 1 ))}${i}")
|
||||||
|
COMPREPLY=("${COMPREPLY[@]}" "${i}")
|
||||||
|
done <<EOF
|
||||||
|
$comps
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
complete -o default -o bashdefault -F _autojump_files cp
|
||||||
|
complete -o default -o bashdefault -F _autojump_files mv
|
||||||
|
|
||||||
#determine the data directory according to the XDG Base Directory Specification
|
#determine the data directory according to the XDG Base Directory Specification
|
||||||
if [ -n "$XDG_DATA_HOME" ]
|
if [ -n "$XDG_DATA_HOME" ]
|
||||||
then
|
then
|
||||||
|
Loading…
Reference in New Issue
Block a user