Your Home/End/PageUp/PageDown keys are not working consistently in terminal programs like vim or zsh.
First, run cat -vt >/dev/null
and type Home, followed by enter. You should see something like below
cat -vt >/dev/null
^[[H
Your output might not look like that, but what you're going to do is check
what the keyboard produces in the specific terminal and compare
against the terminfo description of your current terminal setting.
In the terminfo description ^[
is replaced with \E
.
infocmp|fgrep '\E[H,'
el1=\E[1K, flash=\E[?5h$<100/>\E[?5l, home=\E[H,
So if you see output like the above (home=\E[H
), that means terminfo is correct.
However you probably won't see that because if it was correct you probably wouldn't be here...
In the past I brute-forced fixed this in zsh, by using the bind-key function and just binding the correct commands. my old zshrc showing how to bind home/end/etc
I never had to do this with vim because vim presumably vim has overrides for broken terminfos..
however, the best fix is downloading this file as ~/.terminfo/x/xterm-256color
and using this zsh script that uses terminfo to setup zsh bindkeys