On some Linux machines, when I use vim, I can use PageDown, PageUp, Home, End button nicely without any troubles. However on some other machines, these buttons give me funky characters. 

Why is that, and what can I do? 

Thanks!