That's the problem - vim, mutt and other programs don't recognise the F1 -
F5 keys. When I press F1 in vim it thinks I'm pressing 'A' because the
sequence is [[A where in most consoles in X for example it's [11~.
So far the only way I've found to fix this is make a keymap that binds
those function keys to keys that I don't use often and then set up mappings
in vim to use those keys rather than F1-5.
It could be that your TERM environment variable is not getting set correctly to
the console that you are using.
Does "env | grep TERM" give you the expected answer?
Does running vim as "TERM=linux vim" solve the problem?