on the spur of the moment
Explanation: When you do something on the spur of the moment, you do it without prior planning.
How to use it: [someone] does [something] on the spur of the moment
Example: We went to Boston on the spur of the moment and had such a nice time.