I have a zle widget like:
_ctrl-a() {
CURSOR=0
if ((MARK == 0)); then
zle set-mark-command
fi
if [ "$BUFFERLINES" -gt 1 ]; then
zle end-of-buffer-or-history
else
zle end-of-line
fi
}
zle -N _ctrl-a
bindkey '^A' _ctrl-a # Ctrl+A
It selects the whole buffer. I mean it put cursor at the beginning of the buffer, start marking then put the cursor at the end of buffer.
Here, the widget I am using for multi-line command is end-of-buffer-or-history, however, I want it to be end-of-buffer.
So, I want to replace:
if [ "$BUFFERLINES" -gt 1 ]; then
zle end-of-buffer-or-history
else
zle end-of-line
fi
with
zle end-of-buffer
But there seems to be no widget for end-of-buffer.
What can I do?
P.S. It would be a good learning experience if I could select the whole buffer using MARK variable.