From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 7ea33d52 for ; Wed, 8 Jan 2020 09:06:48 +0000 (UTC) Received: (qmail 2673 invoked by alias); 8 Jan 2020 09:06:41 -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: List-Unsubscribe: X-Seq: 24607 Received: (qmail 19087 invoked by uid 1010); 8 Jan 2020 09:06:41 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f52.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25684. spamassassin: 3.4.2. Clear:RC:0(209.85.166.52):SA:0(-2.0/5.0):. Processed in 2.070202 secs); 08 Jan 2020 09:06:41 -0000 X-Envelope-From: mikachu@gmail.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.166.52 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=0rfDrf5kikKtVPY6Ep/eTHzWyOAGSj/FM8lAdD12r9Y=; b=PYQJNs9TdEsQEy3lYZ9sNNLFT57cI3Qukugz9g9P0VmXTJ+BBsfN9OYGDUG2aaVdgI Y1VyPuPwhqQE5MKrvnVG+cKkNUoqtM8/7zHZ9yHiDIUCPoODCM6RHTr7TmHwytJ1RTUN BkT2N30allmQLccTjIuMISzFdDyCLry5HO8nYIaa4fxREtt7SARjmfdnwd463R/Q01Tq 4ioUVuWQRHlBTPmdXU/WrLMfDDqdAgmu0BXSolHTzIDroarGxKrUtkBRA9ZEU8G3+5I0 EG3Cd+wSKBYP5Lgmb7xCT0PwfsQ98+xEE/m7rNvI5GjuL39/BlzqWegOaN8nshDjDZNa gnBg== X-Gm-Message-State: APjAAAVyYaqTqqpXJqy48k/2pG6IX+SnZYXqqSpSHgIVcVipVFY3aRQL 1JHDgSn/KE0fY7RkpzquyPY47EWpbSN58qrpTA8= X-Google-Smtp-Source: APXvYqy+VhnJVbutXRnm5zZKAzTpvQvmJ/ET2Dkg/aZmyhI6rdJSfzic5zM9yMHjc4PwQLouSA2JDY6QD4aWIqqanq4= X-Received: by 2002:a6b:fe0f:: with SMTP id x15mr2342132ioh.219.1578474365883; Wed, 08 Jan 2020 01:06:05 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: From: Mikael Magnusson Date: Wed, 8 Jan 2020 10:06:05 +0100 Message-ID: Subject: Re: emulate bash key bindings To: Andrey Butirsky Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 1/8/20, Andrey Butirsky wrote: > On 08.01.2020 05:26, Sebastian Gniazdowski wrote: >> On Tue, 7 Jan 2020 at 19:40, Andrey Butirsky wrote: >>> Hello, >>> >>> after 25 years of bash, I'm doing my first steps with Zsh. >>> >>> I'm trying to reproduce main bash key bindings in Zsh, so I started >>> with: >>> >>> autoload -U select-word-style >>> select-word-style bash >>> >>> But sill, I need to have different word boundaries for some bindings, >>> e.g Ctrl+W should kill space-delimeted word. >>> >>> What is the best way to achieve that? Can I avoid creating custom >>> widgets? >> The widget is backward-kill-word. I'd also suggest utilizing the >> ability of bindkey to process multiple arguments at once =E2=80=93 it'll= spare >> some space: >> >> bindkey "^A" beginning-of-line "^E" end-of-line >> bindkey "^?" backward-delete-char "^H" backward-delete-char >> bindkey "^W" backward-kill-word "\e[1~" beginning-of-line >> bindkey "\e[7~" beginning-of-line "\e[H" beginning-of-line >> bindkey "\e[4~" end-of-line "\e[8~" end-of-line >> bindkey "\e[F" end-of-line "\e[3~" delete-char >> bindkey "^J" self-insert "^M" accept-line >> bindkey "^R" history-incremental-search-backward >> > Thanks, but 'backward-kill-word' widget changes it's behavior after > issuing "select-word-style bash" command - it starts kill bash-like > words (alphabet and numeric symbols). So I need bindings for both type > of words, bash-like and space-delimited. You can bind those you want to be space-delimited to widgets with a . in front, it will override the custom widget function select-word-style sets up. bindkey "\e[4~" end-of-line "\e[8~" .end-of-line --=20 Mikael Magnusson