Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

completing nothing



I'm wondering if it's possible to do a tab-completion at the very
start of the command line, with a custom completion (of the empty
command). I see that there's already some special (non-)behavior in
that no completion is attempted, but an actual tab is inserted; the
goal is to override that. I'm working on a kid-friendly setup and
would like them to be able to just say «tab» to see a short list of
simple commands (actually short aliases). So the example would be:

prompt% «tab»
b -- start up a Browser
c -- conCatenate a file to the screen (cat)
d -- show the Directories you've visited (dirs)
e -- Explore in a file browser
f -- Fix your recent history of commands (fc)
j -- see your running Jobs
l -- List files and directories
m -- read the Manual for a command
p -- Print something to the screen
...

A workaround would be to just teach them to use an "h" command that
would accomplish the same thing. Or I could create a set of
comma-started short commands/aliases, so they could just hit ,«tab»
(similar vein to psql/sqlite help) to see them. But I'd prefer to get
them used to hitting «tab» whenever in doubt. This might not be worth
it, but thought I'd ask if it's presently possible. I have a little
experience writing some simple completions with compsys, but just
don't know what to key into with compdef for this empty command.

I'd also like to make sure this doesn't change any default behavior. I
don't see any need to insert an actual tab as is done now, but it
seems if you type $«tab» it should still complete params, and other
such special character at the prompt start would still need to behave
normally.

Regards,
Micah
--
Micah Elliott
Remember your words with Membean. Three free days of learning!



Messages sorted by: Reverse Date, Date, Thread, Author