_kadmin
is probably a completer function for the kadmin
tool - not a directory. If you attempt completion on something that zsh
can't find as a command, a directory or a valid and known command argument completion, it then starts to offer completion functions as possible expansion candidates. By default, zsh
comes with a lot of completers, many of which you may not need - there are bundles for AIX, BSD, Cygwin, various Linux distributions, etc, and they all get read and installed into the shell. If you attempt an expansion on something zsh
can't find, it has all those installed completion functions to offer you instead.
You configure zsh
not to offer completer functions by putting this in your ~/.zshrc
:
zstyle ':completion:*:functions' ignored-patterns '_*'
Reload the file and you should no longer be offered completion functions for tools you don't have installed. Have a look at the zshcompsys
manpage for (a lot) more detail.
EDIT in reply to UPDATE 3
If _kadmin
is actually a user account, you can configure zsh
to not offer it in completions. It seems the approach is to list the user accounts you do want the shell to consider, which limits any names offered only to those listed. The zstyle
line is something like this:
zstyle ':completion:*' users asgeo1 root
I think you can list as many users as you like after the users
tag. The shell will then only offer those users' home directories as possible completions for the cd
function or builtin.
I don't know why adding the username to the ignored-patterns in the completion.zsh
file didn't work - did you reload your config after making the change?
According to the zsh user guide, aliases should be defined in ~/.zshrc
:
You may be able to think of some aliases you want to define in your startup files; .zshrc is probably the right place.
It also has a tip for keeping your ~/.zshrc
clean:
I only tend to use aliases in interactive shells, so I define them
from .zshrc, but you may want to use .zshenv if you use aliases more
widely. In fact, to keep my .zshrc neat I save all the aliases in a
separate file called .aliasrc and in .zshrc I have:
if [[ -r ~/.aliasrc ]]; then
. ~/.aliasrc
fi
which checks if there is a readable file ~/.aliasrc, and if there is,
it runs it in exactly the same way the normal startup files are run.
So, you might want to create a file called ~/.aliasrc
and source it (.
means source
) from your ~/.zshrc
.
The same source suggests that environmental variables should be in ~/.zshenv
:
The easiest place to put these is in .zshenv --- hence it's name. Environment variables will be passed to any programmes run from a shell, so it may be enough to define them in .zlogin or .zprofile: however, any shell started for you non-interactively won't run those, and there are other possible problems if you use a windowing system which is started by a shell other than zsh or which doesn't run a shell start-up file at all --- I had to tweak mine to make it do so. So .zshenv is the safest place; it doesn't take long to define environment variables. Other people will no doubt give you completely contradictory views, but that's people for you.
Best Answer
In zsh, the
time
keyword has no effect on builtins (or other similar shell-internal constructs). From this mailing list post: