whim (n.) Look up whim at Dictionary.com
1640s, "play on words, pun," shortened from whimwham "fanciful object" (q.v.). Meaning "caprice, fancy, sudden turn or inclination of the mind" first recorded 1690s, probably a shortened form of whimsy.