Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: moving to end of line



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@xxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author