From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28176 invoked by alias); 19 Jul 2015 17:16:38 -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: 20324 Received: (qmail 24096 invoked from network); 19 Jul 2015 17:16:37 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL 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:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=Hc7fZ2qZ53a5zpDf+yF2LStT5RWoFVhOrl7sdwSLsaA=; b=hL6yH+jZHDKKQDUNnVzuUlRClLxE5+XM4buIUZ0mKrB47yhbTtCBsITtQCt6vLJQim mXUTgtiDDR00sJK1NJphmM27WfiUjNoI4rMCGZHARelVsMyig8bAE3YAqGQbwdHdmyr7 vQb226Gw9aacf/IEVEZS48H5mMqeOsy3zgxvj1d5b1T3tAFEAKu7XxS6MMRueRFJA2gl rYQIltjjiemhYNpg4+qKogP8tzldvd5+aXPjsHwcUsawCIJzqAX0FcnLLNbcTJ//+miq sN5VydNkcSLujgYX6pgnUc4SZEutY7iWMxSpMt4qEh5UQ3VKF+xf7dtaiOL1tEw0ZnSB vcZg== X-Gm-Message-State: ALoCoQmreBz6weMxtl98KVZId3yJ2GFuQ5GltW+mkNg6Zz5UFyjQVyHQobaHT7aD5AQDC2CM1d+b X-Received: by 10.182.246.9 with SMTP id xs9mr22031489obc.45.1437326195121; Sun, 19 Jul 2015 10:16:35 -0700 (PDT) From: Bart Schaefer Message-Id: <150719101630.ZM12567@torch.brasslantern.com> Date: Sun, 19 Jul 2015 10:16:30 -0700 In-Reply-To: <1ba043ce.69e6ad8b.55ab8974.34833@prokonto.pl> Comments: In reply to rooom "Directory stack completion system" (Jul 19, 1:26pm) References: <1ba043ce.69e6ad8b.55ab8974.34833@prokonto.pl> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Directory stack completion system MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jul 19, 1:26pm, rooom wrote: } } I like "dirs" behaviour more, i.e. abbreviated form of directory } names (with tilde), so how can I set up completion system for "cd -" } to show "~"? There's no zstyle for this, so the _directory_stack function has to be edited. The question is whether a style should be added, or whether the patch below should simply become the default behavior. One approach would be to change "verbose" from a boolean to a ternary value where the third value means "yes" and also chooses whether to apply the (D) flag. E.g., zstyle ':completion:*:directory-stack' verbose long We could also add a keyword for whether to apply the :A modifier to resolve symbolic links. Other suggested approaches? diff --git a/Completion/Zsh/Type/_directory_stack b/Completion/Zsh/Type/_directory_stack index 8a4cf67..5162a1d 100644 --- a/Completion/Zsh/Type/_directory_stack +++ b/Completion/Zsh/Type/_directory_stack @@ -19,7 +19,7 @@ zstyle -s ":completion:${curcontext}:directory-stack" list-separator sep || sep= if zstyle -T ":completion:${curcontext}:directory-stack" verbose; then # get the list of directories with their canonical number # and turn the lines into an array, removing the current directory - lines=("${dirstack[@]}") + lines=("${(D)dirstack[@]}") if [[ ( $PREFIX[1] = - && ! -o pushdminus ) || ( $PREFIX[1] = + && -o pushdminus ) ]]; then