Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Automatically completing commands (and directiories) with <return>
- X-seq: zsh-users 17757
- From: Dominik Vogt <VOGT@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Automatically completing commands (and directiories) with <return>
- Date: Thu, 11 Apr 2013 09:27:19 +0200
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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 ^_^ ^_^
Messages sorted by:
Reverse Date,
Date,
Thread,
Author