* moving to end of line
@ 2003-07-25 21:10 Skye Poier
2003-07-25 21:43 ` Dan Nelson
2003-07-26 21:18 ` moving to end of line Peter Stephenson
0 siblings, 2 replies; 4+ messages in thread
From: Skye Poier @ 2003-07-25 21:10 UTC (permalink / raw)
To: zsh-users
Hi everyone, I'm a recent tcsh convert, and loving it :)
Got everything just the way I like it, except one minor niggling detail.
When I scroll up and down through history with:
bindkey "^[[A" history-beginning-search-backward
bindkey "^[[B" history-beginning-search-forward
It would be really nice to have the cursor moved to the END of the line,
because 99% of the time I just need to change a bit of text on the end
of the command. Is there a way to do that?
I've "setopt ALWAYS_TO_END" but that's only for completion apparently.
(by the way, it would be really nice to be able to specify termcap
entries with bindkey)
Thanks!
Skye
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: moving to end of line
2003-07-25 21:10 moving to end of line Skye Poier
@ 2003-07-25 21:43 ` Dan Nelson
2003-07-25 22:08 ` bindkey/termcap Skye Poier
2003-07-26 21:18 ` moving to end of line Peter Stephenson
1 sibling, 1 reply; 4+ messages in thread
From: Dan Nelson @ 2003-07-25 21:43 UTC (permalink / raw)
To: Skye Poier; +Cc: zsh-users
In the last episode (Jul 25), Skye Poier said:
> Hi everyone, I'm a recent tcsh convert, and loving it :) Got
> everything just the way I like it, except one minor niggling detail.
>
> When I scroll up and down through history with:
>
> bindkey "^[[A" history-beginning-search-backward
> bindkey "^[[B" history-beginning-search-forward
>
> It would be really nice to have the cursor moved to the END of the
> line, because 99% of the time I just need to change a bit of text on
> the end of the command. Is there a way to do that?
I'll leave this question to a widget wizard.
> I've "setopt ALWAYS_TO_END" but that's only for completion apparently.
>
> (by the way, it would be really nice to be able to specify termcap
> entries with bindkey)
I use this:
# Usage: bindtc <cap> <default> <zsh-command>
# If <cap> is unavailable, use <default>
bindtc ()
{
local keyval=$(echotc "$1" 2>&-)
[[ $keyval == "no" ]] && keyval=""
bindkey "${keyval:-$2}" "$3"
}
--
Dan Nelson
dnelson@allantgroup.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: bindkey/termcap
2003-07-25 21:43 ` Dan Nelson
@ 2003-07-25 22:08 ` Skye Poier
0 siblings, 0 replies; 4+ messages in thread
From: Skye Poier @ 2003-07-25 22:08 UTC (permalink / raw)
To: zsh-users
Word on the street is Dan Nelson said:
> # Usage: bindtc <cap> <default> <zsh-command>
> # If <cap> is unavailable, use <default>
> bindtc ()
> {
> local keyval=$(echotc "$1" 2>&-)
> [[ $keyval == "no" ]] && keyval=""
> bindkey "${keyval:-$2}" "$3"
> }
Sweet :D
Skye
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: moving to end of line
2003-07-25 21:10 moving to end of line Skye Poier
2003-07-25 21:43 ` Dan Nelson
@ 2003-07-26 21:18 ` Peter Stephenson
1 sibling, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2003-07-26 21:18 UTC (permalink / raw)
To: Skye Poier; +Cc: zsh-users
Skye Poier wrote:
> Hi everyone, I'm a recent tcsh convert, and loving it :)
> Got everything just the way I like it, except one minor niggling detail.
>
> When I scroll up and down through history with:
>
> bindkey "^[[A" history-beginning-search-backward
> bindkey "^[[B" history-beginning-search-forward
>
> It would be really nice to have the cursor moved to the END of the line,
> because 99% of the time I just need to change a bit of text on the end
> of the command. Is there a way to do that?
autoload -U history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey '\e[A' history-beginning-search-backward-end
bindkey '\e[B' history-beginning-search-forward-end
--
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
Work: pws@csr.com
Web: http://www.pwstephenson.fsnet.co.uk
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-07-26 21:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-25 21:10 moving to end of line Skye Poier
2003-07-25 21:43 ` Dan Nelson
2003-07-25 22:08 ` bindkey/termcap Skye Poier
2003-07-26 21:18 ` moving to end of line Peter Stephenson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).