Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: End of line instead of beginning of line
- X-seq: zsh-users 14503
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: Tommi Airikka <airikka@xxxxxxxxx>
- Subject: Re: End of line instead of beginning of line
- Date: Fri, 16 Oct 2009 13:25:24 +0200
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <c8c061b30910160337h6bcf2f3fubee9b51605f6ca82@xxxxxxxxxxxxxx>
- Mail-followup-to: Tommi Airikka <airikka@xxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <c8c061b30910160337h6bcf2f3fubee9b51605f6ca82@xxxxxxxxxxxxxx>
Tommi Airikka <airikka@xxxxxxxxx>:
> In vi-mode, is there any way to get the cursor directly to the end of
> the line (insert mode) when pressing the up arrow for history, just by
> changing in my local .zshrc?
> It's really annoying that it defaults to the beginning of the line.
>
> I'm using zsh 4.3.6 in a urxvt.
My guess is, that you're on debian or something that uses its zsh
package.
The global debian zshrc (/etc/zsh/zshrc) binds up and down to vi-*
wigdets in vi mode, like this:
[snip]
[[ -z "$terminfo[kcuu1]" ]] || bindkey -M viins "$terminfo[kcuu1]" vi-up-line-or-history
[[ -z "$terminfo[kcud1]" ]] || bindkey -M viins "$terminfo[kcud1]" vi-down-line-or-history
# [...] and fixups for ncurses' application mode:
[[ "$terminfo[kcuu1]" == ""* ]] && bindkey -M viins "${terminfo[kcuu1]/O/[}" vi-up-line-or-history
[[ "$terminfo[kcud1]" == ""* ]] && bindkey -M viins "${terminfo[kcud1]/O/[}" vi-down-line-or-history
[snap]
That is not the default, but possibly closer to the original vi.
Just bind those keys back to the corresponding emacs widgets
(up-line-or-history and down-line-or-history) to get what I think you
want.
Regards, Frank
Messages sorted by:
Reverse Date,
Date,
Thread,
Author