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

RE: vi mode cursor position



Oliver Kiddle wrote:
 
> By default, k is bound to up-line-or-history.
> There are alternatives that differ in terms of the cursor position. For
> example:
> 
>   bindkey -a k history-beginning-search-backward

Thanks! This seems to work for me.

> However that may break other things like moving the cursor in a multi-line
> buffer so you may want to use a custom widget that does something like:

Hmm; I guess I'll know about that once I see it, but testing a multi-line buffer seems to work fine. I tested a multi-line buffer with:

echo "now is the time "\
> "for all good men"

>   if [[ $LBUFFER == *$'\n'* ]]; then
>     zle .up-line
>   else
>     zle .history-beginning-search-backward
>   fi

I put this in my .zshrc file and it didn't seem to change anything.

Thanks again, Oliver, I really appreciate your response.

CP



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