From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24695 invoked by alias); 27 Oct 2012 06:38:45 -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: 17354 Received: (qmail 14137 invoked from network); 27 Oct 2012 06:38:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=FUM7iRuboVIZYH/LKEFV7EHiyMCPPj609It4kINxxcU=; b=HtzSBrfpOZqcEQDCoFdmQw8KmTh3MhKGM3LIe0vvH4n05e1ljucGKjElybJ4Peo0eS 01Ebf16JGu+lihZQ55fj0PJbAZbtg0qLiO7ICixOK8Vd0rDcwIBrN7uJ+0BoAjmNZb3/ 3U6zyJMu82E3arS2+MpV8aWB/4Yr/58/Du2jAHqEVBsCJYnWQs7BMYPMwPOWLAH5Cf3L LucVUjp09FCCLhWeDavTFCV0jfOcHzeIQfKE3wckRw+OVLbKG2BWWnGtoQaQDD71Xicz utCLN9JlJliPBNrd4kLVvMmmSE08ZUHI6EiO2qjySwU/guYpeLSjRy0EDSZuW3WWiJFQ toVA== MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 26 Oct 2012 23:38:35 -0700 Message-ID: Subject: Re: change inside From: Bart Schaefer To: Zsh Users Content-Type: multipart/alternative; boundary=047d7bdc103685004004cd04af41 X-Gm-Message-State: ALoCoQnOAUhVV/+olHwcUsrDC4YqG/bKyZ1zosbv7SSOnna3IiEvJKcXucZHFp+i04Uq7d9aUArE --047d7bdc103685004004cd04af41 Content-Type: text/plain; charset=ISO-8859-1 On Friday, October 26, 2012, shawn wilson wrote: > i use vim bindkeys and am quite happy with it. however one feature > that i use a lot in vim is the 'inside' feature - di, ci, yi, etc. and > i don't seem to have this on the shell. what's the best way to make > something like this work and/or could this be implemented to make this > more like native vim? > You will need to create a custom zle widget, or rather, a set of them. The basics of finding the "inside" or "around" are the same for all of them, so you can probably get by with one function that is attached to several widget names and decides what to do based on the value of $WIDGET. The first thing the function should do is invoke "zle vi-find-next-char", this should take care of reading the target character for the inside/around boundary. Then $BUFFER[CURSOR] is that character, so you can use it to find the previous occurrence of the same. Then you can set $MARK, move the cursor to that previous occurence, and call something such as the kill-region builtin or the narrow-to-region function to implement the action for $WIDGET. --047d7bdc103685004004cd04af41--