From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 5DEA421321 for ; Thu, 15 Feb 2024 16:30:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:cc:Reply-To: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=9QcZcQ5OpBcJcWq5/63cDRTDhjFceOxEwlDpdgzSYOw=; b=s1b6qG8YieCLZ41+sm2oKNXdpL MiTFtnPyS72a0AnC/rJWnvuHYHs/UC+Rx8JkoXZQxzpnNmEM/5D6CXFGTKsC/ZRMpq65Oy167OymN 2OVkE4/ectpty5WMJL1Od36CAghVLVe+wSHHwCWXrcrE1+sKArFVQusf36ahN+oimi5XU2LDIb3jr k6VNu/xl8u4XXuNGZ4Uq8z4i/bg3DhqtFXahRDNdSvUn5k+GdmDFsTo+J81ZKhnCmqS30JB8l6vV5 NV/ciVLlpMjmldW8ggVZSUvZGcOQ8UxNQf1TobuaYN9S0jUOjRAlhvRXO432f+lI7p0EgWBgWEDD4 PQ6pB9oQ==; Received: by zero.zsh.org with local id 1radhB-000LEL-97; Thu, 15 Feb 2024 15:30:41 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1radgk-000KiE-5M; Thu, 15 Feb 2024 15:30:14 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.97.1) (envelope-from ) id 1radgi-00000000FK0-3oT7; Thu, 15 Feb 2024 16:30:13 +0100 cc: zsh-workers@zsh.org In-reply-to: <20240204191938.42759-1-git@midchildan.org> From: Oliver Kiddle References: <20240204191938.42759-1-git@midchildan.org> To: midchildan Subject: Re: [PATCH] add new features and improvements to the "incarg" ZLE widget MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <58898.1708011012.1@hydra> Date: Thu, 15 Feb 2024 16:30:12 +0100 Message-ID: <58899-1708011012.905219@Bjdj.O9XV.UdPU> X-Seq: 52543 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On 5 Feb, midchildan wrote: > This brings numerous improvements to the incarg ZLE widget that's used > to increment an integer under the cursor. I find myself incrementing > numbers very often when editing commands from shell history. I > originally used incarg for this, but I missed a couple of features from > Vim's increment command. The contents of this PR is what I've eventually > settled on. I have just applied this after doing some testing. I have a couple of minor comments that can perhaps be addressed in a follow-up patch. If it fails to find a number going forwards in the buffer, it'd be useful if it could look backwards too. In contrast to an editor, the cursor is more often at the very end of the buffer in a shell. I think that just adding zle -f vichange to the beginning of the function it will work together with vi-repeat-change (.) which brings it closer to ^A/^X in vim. Oliver