zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: Zsh completion configuration
Date: Tue, 26 Feb 2013 19:26:29 -0800	[thread overview]
Message-ID: <130226192629.ZM5352@torch.brasslantern.com> (raw)
In-Reply-To: <CAHjjW16gsV77y-+BZuQiD0R+=ptMuy5NJ3syXw1sOQzGAdSfeg@mail.gmail.com>

On Feb 26,  7:41pm, joe M wrote:
}
} > And then install it for the context:
} >
} >     compdef _history_or_autocd -command-
} 
} I do not understand the "install" process. Is it good enough to have
} the function file (_history_or_autocd) anywhere in the $fpath? Or,
} does it have to be after the directory with _autocd?

Sorry, I wrote that as if you were going to put it in ~/.zshrc.  To put
it in a file by itself, it has to be in a directory in $fpath that is
listed BEFORE the directory containing _autocd, and the file should look
like

    #compdef -command-
    _history
    local ret=$?
    _autocd || return ret

(without the indentation, of course).

} I added this "zstyle ':completion::complete:-command-:*'
} _history_or_autocd" to my zshrc

No, you don't need that.  Either the compdef command in ~/.zshrc, or the
file formatted as above with #compdef, is all that's necessary.

} Just a rehash did not do the job. Any thoughts, please?

Rehash doesn't reload functions, nor does it reset completion definitions
(the _comps variable).  To install just the one function, use compdef as
a command.  To reload the entire completion system, delete ~/.zcompdump
and run "compinit" (which has the effect of executing a whole bunch of
"compdef" commands computed from the #compdef lines).

-- 
Barton E. Schaefer


  reply	other threads:[~2013-02-27  3:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 19:47 joe M
2013-02-26 16:05 ` Bart Schaefer
2013-02-27  0:41   ` joe M
2013-02-27  3:26     ` Bart Schaefer [this message]
2013-02-27 15:54       ` joe M

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=130226192629.ZM5352@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).