Are you running hammer from a different game (portal,hl2? or something), are you just opening the .exe or through steam? Sounds weird.
In your autoexec you can just add any custom keybinding you have towards the end (e.g. if you used chris' config or something similar).
e.g. stuff like:
bind w "+forward;"
its pretty easy to find the code/language for common actions in tf2 (jump, crouch, shoot etc.) by googling