From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12985 invoked by alias); 10 Dec 2016 00:54:48 -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: 22178 Received: (qmail 29422 invoked from network); 10 Dec 2016 00:54:48 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua0-f172.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.217.172):SA:0(0.0/5.0):. Processed in 1.65092 secs); 10 Dec 2016 00:54:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.172 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=SdVkhvIvG9DoA/B75y2vE2kvkbRLCJcxZcoQuVTECCw=; b=n+cs6g8X62HivEJBVtopzjbperU7MsWRNjhc9M0KP4vb8zHfPUOO14iC4rnal5/5Mc emVvr6294dQEFlAjLcaZtaEsm97WFS6GyStI8goBEGQimRTL2IpQz01KmjIOV0rqAfwC OHudekFQHGlY16iOiGC5jUm76yGbxqSveIXVCO19Ujwddx74AK2W4ISYpBK+k4gwExL8 0KDNXx3WjiwV5YWNxFb7pt38P501SkKjElp0RTkfJg+7W8srDCTwfBpaKyD9tP3FKTgj XfXmPcczfhEBvipR3oL9udoKWs7G/a2Hk1Tb+941RgLM2exMG4vF8eLi2e1fKhnGQSZn nIVA== 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; bh=SdVkhvIvG9DoA/B75y2vE2kvkbRLCJcxZcoQuVTECCw=; b=M/iHz4O4S6bT5J/o8VHzjbJo5GrY+zcqHaoymX1Y/ztRxLVdCclcQNXI/63dP6ECeP bDxqUL8ITcMbclqvf7OTy9gDeJ2SPmU9Y0MZ8xCD74wQOQOkio7DtWE2tlAcedc9Y0t3 ZfwrYl7wncb0jZVOXvN6BE9NEaWuVjTSGYJ+2ia4doogrVfH5/XjG/2qnT/Omu7hdSvk WlvFyAoArG105//eNHHwpvNDp426mF1kyRHSinn+VkaVIrXrGAd1C67MD2rtUUESQCay fcsufe/okGYNuK+liNPM80SjRkHOtuMZNDFhP0yOAZKWgriKssJXp2g3ujU/cX15qkzW g82Q== X-Gm-Message-State: AKaTC01gIHMCCZcalCLZKFWB7rbx/R+S4jusdF10EFoj89Aw9phXu56Wc01gFbX8SkOe0w== X-Received: by 10.176.4.12 with SMTP id 12mr64154447uav.81.1481331276759; Fri, 09 Dec 2016 16:54:36 -0800 (PST) From: Bart Schaefer Message-Id: <161209165454.ZM9226@torch.brasslantern.com> Date: Fri, 9 Dec 2016 16:54:54 -0800 In-Reply-To: <584AEDBF.2050402@eastlink.ca> Comments: In reply to Ray Andrews "Re: off topic" (Dec 9, 9:45am) References: <20161209122958.GD19559@256bit.org> <57127.1481294647@hydra.kiddle.eu> <584AC8AC.9050406@eastlink.ca> <62522.1481300922@hydra.kiddle.eu> <584AEDBF.2050402@eastlink.ca> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: off topic MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Dec 9, 9:45am, Ray Andrews wrote: } Subject: Re: off topic } } On 12/09/2016 08:28 AM, Oliver Kiddle wrote: } } Thanks Oliver: } > There's clear advantages to having a powerful setup that you } > understand well. If that process now involves "brutality" then you can } > understand why people might be be happy to just take what they get } > with oh-my-zsh: and I don't view that as heresy. Oliver } } I know I've ranted about this before, but I sure wish there was } something in between. I've had the below kicking around for a while, was planning to post it after 5.3 was out but might as well offer it for comments. This is mostly specific to completion; it collects what I think are a set of sensible default settings to make completion "pretty" and informative without adding so many special-cases that the user gets lost. It's also designed to be source-able at any point either before or after the user's own zstyles without stomping on anything. Some of these are pulled directly from examples in the manual, some from zsh-newuser-install, others from various suggestions that have gone by on the mailing lists, etc. --- 8< --- 8< --- 8< --- # Safely define default values for assorted completion zstyles emulate zsh -o extendedglob -c 'default_zstyle() { local -a patstyle defn if [[ "$1" = (-e|-|--) ]] then patstyle=( "$2" "$3" ) else patstyle=( "$1" "$2" ) fi zstyle -g defn "${patstyle[@]}" || zstyle "$@" }' ### autoload -Uz colors && colors ### default_zstyle ':completion:*' completer \ _expand _complete _ignored _correct _approximate # General appearance default_zstyle ':completion:*' menu 'yes=long' 'select=long-list' default_zstyle ':completion:*' group-name '' default_zstyle ':completion:*' verbose true default_zstyle ':completion:*' ignore-parents parent pwd .. default_zstyle ':completion:*' format '%BCompleting %U%d%u%b' default_zstyle ':completion:*:messages' format %S%d%s default_zstyle ':completion:*:warnings' format 'No matches for %U%d%u' default_zstyle ':completion:*:corrections' format \ '%BCompleting %U%d%u (errors: %e)%b' # Insert all expansions for expand completer default_zstyle ':completion:*:expand:*' tag-order all-expansions # Allow one error for every three characters typed for _approximate default_zstyle -e ':completion:*:approximate:*' max-errors \ 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )' # Allow two errors elsewhere, e.g. for _correct default_zstyle ':completion:*' max-errors 2 numeric # Double colon here to avoid overriding the value set by "zed" default_zstyle ':completion::*' insert-tab 'pending=1' # Matching # 1. Try completion with no alterations (i.e., literal match is best) # 2. Match substrings separated by dashes, dots, underscores, commas # 3. As (2) but case-insensitively # 4. As (2) but allow arbitrary stuff at the beginning of the result default_zstyle ':completion:*' matcher-list '' 'r:|[-._,]=** r:|=**' \ 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[-._,]=** r:|=**' \ 'r:|[-._,]=** r:|=** l:|=*' # Offer indexes before parameters in subscripts default_zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters # Ignore completion functions (until the _ignored completer) zstyle ':completion:*:functions' ignored-patterns '_*' # From Oliver Kiddle, users/20372, for process lists default_zstyle ':completion:*:(kill|lsof|ps|ss):*:' tag-order \ processes:-tty 'processes:-mine:user\ processes' \ 'processes:-all:all\ processes' default_zstyle ':completion:*:([sl]trace|truss|gcore|(ll|g)db):*:' tag-order \ processes:-mine 'processes:-all:all\ processes' case $OSTYPE in *bsd*) default_zstyle ':completion:*:processes' command \ 'ps -o pid,ppid,state,start,args' default_zstyle ':completion:*:processes-mine' command \ "ps U $EUID -o pid,ppid,state,start,args" default_zstyle ':completion:*:processes-all' command \ "ps A -o pid,ppid,state,start,args" ;; *) default_zstyle ':completion:*:processes' command \ 'ps -o pid,s,ppid,stime,args' default_zstyle ':completion:*:processes-mine' command \ "ps -u $EUID -o pid,s,ppid,stime,args" default_zstyle ':completion:*:processes-all' command \ 'ps -e -o pid,s,ppid,stime,args' ;; esac # Avoid subverting list-colors, otherwise show-ambiguity reverse-video default_zstyle -e ':completion:(#b)(*)' show-ambiguity \ 'zstyle -T ":completion:$match" list-colors && reply=( ${color[reverse]} )'