* Automatically completing commands (and directiories) with <return>
@ 2013-04-11 7:27 Dominik Vogt
0 siblings, 0 replies; only message in thread
From: Dominik Vogt @ 2013-04-11 7:27 UTC (permalink / raw)
To: zsh-users
I'd like to enhance the idea from my previous thread. Aussuming
I have the autocd option set I would like to code the following
behaviour
-- BEGIN idea
IF
The user types a command line, hits <return> and the first word
does not resolve to a file or directory name (this does not apply
if the file of directory exists but has unsuitable permissions):
THEN
Zsh attempts to complete the first work just as if the cursor was
at the end of the partial first word and the user had pressed
<tab>. After that:
IF
There is only one possible completion for the first word,
THEN
complete it automatically and execute the command line
immediately. (It might be worthwhile to not execute
immediately but allow the user to review the completed word
and let her edit the line if necessary or execute it by
pressing <return> again.)
ELSE
Put the cursor right after the partial first word and begin
completion just as if the user had pressed the <tab> key.
-- END idea
You could just type
./co<return>
to execute "./command-with-a-very-long-name", or
./di<return>
to cd into "./directory-with-a-very-long-name".
Anyway, I'm not exactly sure if you really win anything over typing
./co<tab><return>
though. Hmmm.
Ciao
Dominik ^_^ ^_^
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-04-11 7:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-11 7:27 Automatically completing commands (and directiories) with <return> Dominik Vogt
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).