Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: vi-mode zle: how to delete past the start char of insert mode (like VIM 'backspace'=start option)
- X-seq: zsh-users 14438
- From: Anton Sharonov <anton.sharonov@xxxxxxxxx>
- To: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- Subject: Re: vi-mode zle: how to delete past the start char of insert mode (like VIM 'backspace'=start option)
- Date: Sun, 27 Sep 2009 22:31:55 +0200
- Cc: zsh-users@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=TiCx5pfEiS2cY25Ox+tE0G39kn/79gjgrMLLfn33DPk=; b=MjUhRxoMzSgCtsuS8HiR02oY5bLGuYANosoeM8B7nR4RvgXaW/Oo3KfmL6rWYD3ue8 fbXrIXUpCATL7m1awPoDc+Eki6sd5+mixNdWkRy3wPZzG++fxzrQJN38DhPyPG1we0Xj /AutT4ZraOtEGHF6Hc1W4Ylq8zJn4wFzt1rWw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=wfw3+8aNTkC+2ZHCK2+bUUCW3Ri1ejlKC+sdGnrt/3EyooMs6giXhqqSRnAtVGXF+G fGuAn+e6qEDKUq9m3L5krxYhHC4oNgMsMgEChfyAxNG7MgNiGpKSP5o1qX7OEkSdWrTJ fWKwZ5Vcj463s3DePjGMjfh8Q7x+onGgIz7jY=
- In-reply-to: <20090927184356.4679e812@pws-pc>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <ef9dd2250909270703v7d7dfd45hfdf3e9750afa020f@xxxxxxxxxxxxxx> <20090927184356.4679e812@pws-pc>
On 27/09/2009, Peter Stephenson <p.w.stephenson@xxxxxx> wrote:
> On Sun, 27 Sep 2009 16:03:53 +0200
> Anton Sharonov <anton.sharonov@xxxxxx> wrote:
>> How can I tell zshzle that I like to be able to delete past the
>> point of _start_ of the insert mode ?
>
> Replace the "vi-" style bindings with the non-vi equivalents, which
> don't care about the insertion point.
>
> bindkey -M viins '^h' backward-delete-char
> bindkey -M viins '^?' backward-delete-char
> bindkey -M viins '^w' backward-kill-word
>
> etc.
I can confirm, works fine for me.
>
> You can be a bit smarter by replacing the widgets themselves,
>
> zle -A .backward-kill-word vi-backward-kill-word
> zle -A .backward-delete-char vi-backward-delete-char
>
> which means you don't need to worry about what they're bound to them.
Awesome, this works as well !
For now I will just write down all the possibilities you showed
me, and since I don't know which one is better,
I will stick with the following suggestion
# from the zsh-user, Bart Schaefer:
bindkey "^W" backward-kill-word # vi-backward-kill-word
bindkey "^H" backward-delete-char # vi-backward-delete-char
bindkey "^U" backward-kill-line # vi-kill-line
bindkey "^?" backward-delete-char # vi-backward-delete-char
Thanks for your help !
--
Anton
>
> --
> Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
> Web page now at http://homepage.ntlworld.com/p.w.stephenson/
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author