From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17966 invoked by alias); 11 Apr 2013 07:37:53 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17757 Received: (qmail 15637 invoked from network); 11 Apr 2013 07:37:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at de.ibm.com designates 195.75.94.111 as permitted sender) Subject: Automatically completing commands (and directiories) with X-KeepSent: E3E25CFA:FEA9DFED-C1257B4A:002795AE; type=4; name=$KeepSent To: zsh-users@zsh.org X-Mailer: Lotus Notes Release 8.5.3 September 15, 2011 Message-ID: From: Dominik Vogt Date: Thu, 11 Apr 2013 09:27:19 +0200 X-MIMETrack: Serialize by Router on D06ML035/06/M/IBM(Release 8.5.3FP2 ZX853FP2HF3|December 12, 2012) at 11/04/2013 09:27:27 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13041107-0342-0000-0000-000004B118DA 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 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 . 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 again.) ELSE Put the cursor right after the partial first word and begin completion just as if the user had pressed the key. -- END idea You could just type ./co to execute "./command-with-a-very-long-name", or ./di to cd into "./directory-with-a-very-long-name". Anyway, I'm not exactly sure if you really win anything over typing ./co though. Hmmm. Ciao Dominik ^_^ ^_^