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

Automatically completing commands (and directiories) with <return>

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

-- BEGIN idea

  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):


  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:


    There is only one possible completion for the first word,


    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.)


    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


to execute "./command-with-a-very-long-name", or


to cd into "./directory-with-a-very-long-name".

Anyway, I'm not exactly sure if you really win anything over typing


though.  Hmmm.


Dominik ^_^  ^_^

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