How to extend existing zsh completion functions?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'm trying to add auto-completion for some custom ant parameters. However, it seems to be overwriting the existing oh my zsh ant plugin auto-completions which I'd like to keep. Is there a simple way to have both the oh my zsh plugin and my custom ant auto-completion live in harmony?
Here's the existing plugin at ~/.oh-my-zsh/plugins/ant/ant.plugin.zsh
_ant_does_target_list_need_generating ()
[ ! -f .ant_targets ] && return 0;
[ build.xml -nt .ant_targets ] && return 0;
return 1;
_ant ()
if [ -f build.xml ]; then
if _ant_does_target_list_need_generating; then
ant -p
compdef _ant ant
And my auto complete at ~/my_completions/_ant
#compdef ant
_arguments '-Dprop=-[properties file]:filename:->files' '-Dsrc=-[build directory]:directory:_files -/'
case "$state" in
files)
local -a property_files
property_files=( *.properties )
_multi_parts / property_files
;;
esac
And here is my $fpath
/Users/myusername/ralph_completion_fun /Users/myusername/.oh-my-zsh/plugins/git /Users/myusername/.oh-my-zsh/functions /Users/myusername/.oh-my-zsh/completions /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.0.8/functions
zsh autocomplete oh-my-zsh
New contributor
add a comment |Â
up vote
0
down vote
favorite
I'm trying to add auto-completion for some custom ant parameters. However, it seems to be overwriting the existing oh my zsh ant plugin auto-completions which I'd like to keep. Is there a simple way to have both the oh my zsh plugin and my custom ant auto-completion live in harmony?
Here's the existing plugin at ~/.oh-my-zsh/plugins/ant/ant.plugin.zsh
_ant_does_target_list_need_generating ()
[ ! -f .ant_targets ] && return 0;
[ build.xml -nt .ant_targets ] && return 0;
return 1;
_ant ()
if [ -f build.xml ]; then
if _ant_does_target_list_need_generating; then
ant -p
compdef _ant ant
And my auto complete at ~/my_completions/_ant
#compdef ant
_arguments '-Dprop=-[properties file]:filename:->files' '-Dsrc=-[build directory]:directory:_files -/'
case "$state" in
files)
local -a property_files
property_files=( *.properties )
_multi_parts / property_files
;;
esac
And here is my $fpath
/Users/myusername/ralph_completion_fun /Users/myusername/.oh-my-zsh/plugins/git /Users/myusername/.oh-my-zsh/functions /Users/myusername/.oh-my-zsh/completions /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.0.8/functions
zsh autocomplete oh-my-zsh
New contributor
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to add auto-completion for some custom ant parameters. However, it seems to be overwriting the existing oh my zsh ant plugin auto-completions which I'd like to keep. Is there a simple way to have both the oh my zsh plugin and my custom ant auto-completion live in harmony?
Here's the existing plugin at ~/.oh-my-zsh/plugins/ant/ant.plugin.zsh
_ant_does_target_list_need_generating ()
[ ! -f .ant_targets ] && return 0;
[ build.xml -nt .ant_targets ] && return 0;
return 1;
_ant ()
if [ -f build.xml ]; then
if _ant_does_target_list_need_generating; then
ant -p
compdef _ant ant
And my auto complete at ~/my_completions/_ant
#compdef ant
_arguments '-Dprop=-[properties file]:filename:->files' '-Dsrc=-[build directory]:directory:_files -/'
case "$state" in
files)
local -a property_files
property_files=( *.properties )
_multi_parts / property_files
;;
esac
And here is my $fpath
/Users/myusername/ralph_completion_fun /Users/myusername/.oh-my-zsh/plugins/git /Users/myusername/.oh-my-zsh/functions /Users/myusername/.oh-my-zsh/completions /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.0.8/functions
zsh autocomplete oh-my-zsh
New contributor
I'm trying to add auto-completion for some custom ant parameters. However, it seems to be overwriting the existing oh my zsh ant plugin auto-completions which I'd like to keep. Is there a simple way to have both the oh my zsh plugin and my custom ant auto-completion live in harmony?
Here's the existing plugin at ~/.oh-my-zsh/plugins/ant/ant.plugin.zsh
_ant_does_target_list_need_generating ()
[ ! -f .ant_targets ] && return 0;
[ build.xml -nt .ant_targets ] && return 0;
return 1;
_ant ()
if [ -f build.xml ]; then
if _ant_does_target_list_need_generating; then
ant -p
compdef _ant ant
And my auto complete at ~/my_completions/_ant
#compdef ant
_arguments '-Dprop=-[properties file]:filename:->files' '-Dsrc=-[build directory]:directory:_files -/'
case "$state" in
files)
local -a property_files
property_files=( *.properties )
_multi_parts / property_files
;;
esac
And here is my $fpath
/Users/myusername/ralph_completion_fun /Users/myusername/.oh-my-zsh/plugins/git /Users/myusername/.oh-my-zsh/functions /Users/myusername/.oh-my-zsh/completions /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.0.8/functions
zsh autocomplete oh-my-zsh
zsh autocomplete oh-my-zsh
New contributor
New contributor
New contributor
asked 2 mins ago
Ralph Callaway
1012
1012
New contributor
New contributor
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Ralph Callaway is a new contributor. Be nice, and check out our Code of Conduct.
Ralph Callaway is a new contributor. Be nice, and check out our Code of Conduct.
Ralph Callaway is a new contributor. Be nice, and check out our Code of Conduct.
Ralph Callaway is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477142%2fhow-to-extend-existing-zsh-completion-functions%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password