I sometimes say holy cow or crap whenever something shocking happens, I used this words because these words are used instead of a swear word as this wouldn't be considered swearing? But I wanna know is this still haram?
If it became a habit, but your intention is to not say that, then you should not worry too much, but strive to avoid using these kind of phrases. And there are way more excellent words to use than to be persuaded of such phrases. Whenever you say something harmful, follow it with a good deed or by seeking forgiveness for example with "Astaghfirullah".
When you are with a group of people, and you either do or do not know if you said something badly or redundant, then read this hadith:
The Messenger of Allah (ﷺ) said: “Whoever sits in a sitting and engages in much empty, meaningless speech and then says before getting from that sitting of his: ‘Glory is to You, O Allah, and praise, I bear witness that there is none worthy of worship except You, I seek You forgiveness, and I repent to You, (Subḥānaka-Allāhumma wa biḥamdik, ashhadu an lā ilāha illā ant, astaghfiruka wa atūbu ilayk)’, whatever occurred in that sitting would be forgiven to him.” At-Tirmidhi (3433) graded Sahih