zsh-users
 help / color / mirror / code / Atom feed
From: Dominik Vogt <VOGT@de.ibm.com>
To: zsh-users@zsh.org
Subject: Automatically completing commands (and directiories) with <return>
Date: Thu, 11 Apr 2013 09:27:19 +0200	[thread overview]
Message-ID: <OFE3E25CFA.FEA9DFED-ONC1257B4A.002795AE-C1257B4A.0028F7D9@de.ibm.com> (raw)


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 ^_^  ^_^


                 reply	other threads:[~2013-04-11  7:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=OFE3E25CFA.FEA9DFED-ONC1257B4A.002795AE-C1257B4A.0028F7D9@de.ibm.com \
    --to=vogt@de.ibm.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).