From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18572 invoked by alias); 30 Apr 2018 19:54:18 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42738 Received: (qmail 18018 invoked by uid 1010); 30 Apr 2018 19:54:18 -0000 X-Qmail-Scanner-Diagnostics: from know-smtprelay-omc-2.server.virginmedia.net 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(80.0.253.66):SA:0(-1.9/5.0):. Processed in 1.906464 secs); 30 Apr 2018 19:54:18 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: dave@dawoodfall.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Originating-IP: [82.40.94.2] X-Authenticated-User: X-Spam: 0 X-Authority: v=2.3 cv=Ab+f4UfG c=1 sm=1 tr=0 a=EH02hVpzcg1gP5HQFHlsKw==:117 a=EH02hVpzcg1gP5HQFHlsKw==:17 a=IkcTkHD0fZMA:10 a=a1Uoi5jeAAAA:8 a=w4r4kPNYuPk4ZWHfoHUA:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=QEXdDO2ut3YA:10 a=b5GIbgGVya4qEPgWM5ed:22 Date: Mon, 30 Apr 2018 20:54:11 +0100 From: David Woodfall To: zsh-workers@zsh.org Subject: Re: Using menu completion after predict Message-ID: <20180430195411.GI24131@blackswan> Mail-Followup-To: zsh-workers@zsh.org References: <20180430162644.GG24131@blackswan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: <20180430162644.GG24131@blackswan> User-Agent: Mutt/1.9.4+99 (e250c602) (2018-03-15) X-CMAE-Envelope: MS4wfBVP4I2G9tJgYvuvFKTnB9N1rlZ9f30DZ9JNWR8XX+8rjvbHf7VRt30fvLeUNJIvDro7tg+NhiDPl/4WmvCVDDLFkAD8vsxy/7ORwBy8h66K9oQpcRxx EunQhbfw/URuNZEgxHx7Ci24UxXKE9O9LqLBYZlGlTrP1lRthnctXmbJ On Monday 30 April 2018 17:26, Dave Woodfall put forth the proposition: >Hi > >I've been experimenting with the predict completer and it works well. >There is something that I haven't been able to figure out yet though. > >When using, say, cdr with menu complete, when I first type 'cdr ' >predict brings up the last match in history. Let's say: > >crd 4 > >I press tab for menu complete to activate but the '4' stays on the >command line, which means that after selecting an entry from the >list I now have two numbers, say: > >cdr 4 1 > >Of course cdr will give an error if I try to execute the command. > >Is there a way of clearing the prompt line when certain menu >completions activate, like cdr, so that this doesn't occur? > >I know I can use a bind to kill to eol, but I'd rather have some >filter or completion option for ':completion:*:*:cdr:*:*' that would >clear to the end of the line before entering the selection menu. > >These are my current settings: > >zstyle ':completion:*' menu select yes=long-list select=long-list >zstyle ':completion:*' completer _complete _match _approximate \ > _correct _expand _prefix >zstyle ':completion::prefix:*' completer _complete >zstyle ':completion:*:*:cdr:*:*' menu selection >zstyle ':completion:*:*:cdr:*:*' completer _complete >zstyle ':completion:predict:*' completer _history >zstyle ':predict' menu select no >zstyle ':predict' toggle true >zstyle ':predict' verbose true >zstyle ':predict' cursor complete > >Any help is greatly appreciated. > >-Dave > Well I've made a workaround that is OK so far. _vi_tab() { if [ "$KEYMAP" = "vicmd" ]; then zle vi-add-eol zle vi-insert else zle vi-kill-eol zle menu-expand-or-complete fi } Probably not the proper solution, but it saves deleting the command line manually. -Dave