1) Leave ASAP
2) Take this as an opportunity to learn something which is really common with (senior) SW developers
I am not gonna tell you that (2) is easy. It's actually extremely hard, it can get even harder than what you think right now. However, time-box your learning experience: how long before you leave? how long before you have a nervous breakdown? In the meantime, try to learn as much as possible about communication with this difficult colleague. Some resources you might want to use are
- Nonviolent Communication: A Language of Life
- Getting to Yes: Negotiating an agreement without giving in
- Difficult Conversations: How to Discuss What Matters Most
Then you can follow any other advice given here, like talk to your manager, etc. However, be cautious there, especially when talking about someone that has already some sort of power.