From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11523 invoked by alias); 18 Aug 2015 14:38:18 -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: 20428 Received: (qmail 27756 invoked from network); 18 Aug 2015 14:38:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=wHakoKpZ1xLSdV5Z04Da5ZrBpi3uxme/YA6kvW8uWPg=; b=SauFrC52D0LFe+e273nd6lF6wt3kXvqF/w/6OinPtZS1UykVE8XSuPDN/QnB+IA4dt SC6Ckt5+uVctb6lyr2FB386bk8J492NB7K4bx+Eis5M1ZyJ1yFM6w/DhLqIwOQWsDrKC mgSVDVrXVmVb9YbbwlZ1nHuc5bKbC5cv3AJ7xQk+PO8J0XZJ/1NCodSPDk2r84jPAQTT UkdNx2aNTFLASTxvdfFizVIeckwRJ+wDhcvbtd6/uGoa6AVp4WK3JGsmtRa1DNAcMcTB SIbwxqoH5oE4qe20Bd5MCr05/LTAHVPGK1sz2JfaVyx4ZsOqLm6z7ymBMt6PZKPRxwI8 +byw== X-Gm-Message-State: ALoCoQmrTSnMZPlPtOXKBPlPsyVXjnGgCxxcH/YE213Q3X1lLEoNd7UZxnpVtVQJZDgC2u3PK/sK MIME-Version: 1.0 X-Received: by 10.129.116.138 with SMTP id p132mr7603150ywc.1.1439908693649; Tue, 18 Aug 2015 07:38:13 -0700 (PDT) Date: Tue, 18 Aug 2015 11:38:13 -0300 Message-ID: Subject: Case-aware completion that respects the user-entered case From: Joshua Buxton To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=001a1147f6ac31e0b4051d96de0d --001a1147f6ac31e0b4051d96de0d Content-Type: text/plain; charset=UTF-8 As per the discussion here: http://www.zsh.org/mla/users/2003/msg00611.html I'm trying to do the same thing: have zsh respect the case I used, but still offer case-insensitive matches when tab is pressed. Test suite: ./Temp1 ./temp2 ./temp3 ./tEMP4 What I'm looking for: "cd te" fills in "cd temp" then stops. pressing again brings up a menu that suggests the case-sensitive option first: "temp2/ temp3/ Temp1/ tEMP4/" The suggestion in the thread almost fits: _cscomplete() { _complete return 1 } zstyle ':completion:*:cscomplete:*' group-name case-sensitive zstyle ':completion:*:complete:*' group-name case-insensitive zstyle ':completion:*' group-order case-sensitive case-insensitive zstyle ':completion:*::::' completer _cscomplete _complete zstyle ':completion:*:cscomplete:*:*' matcher-list '' zstyle ':completion:*:complete:*' matcher-list 'm:{a-z}={A-Z}' "cd te" fills in "cd temp" then stops. pressing again brings up a menu that suggests the case-sensitive option first: "temp2/ temp3/ Temp1/ temp2/ temp3/ tEMP4/" Unfortunately, if "cd Te" is used, "cd Temp1/" is filled in and nothing else will be suggested. Is there a way to modify the code above so that the same second menu ("Temp1/ temp2/ temp3/ tEMP4/") is shown, even when a single match is found? *As you may be able to tell, I don't understand how zstyle works. I'm just trying to scratch the one itch in an otherwise perfect solution.* Thanks in advance -- I am also a systems administrator by trade, a teacher by nature, and a mindful cook by passion. Sent from my iPhone --001a1147f6ac31e0b4051d96de0d--