When I was at age of 18-19, even though i can read quran at that time(arabic), perform salah and kept full month ramadhan fast I didn't knew what is shirk, didn't heard of this word before till i reach 21. At this age i started gaining knowledge of teaching of islam, our beloved prophet and haram/halal all other stuff.   
At this very age of 18-19 I thought of going to other place worship(i.e temple) and pray like my friends used to do, as all my friends are non-muslim.
Now i have realize that I thought of doing shirk. It is worst thing to do in one life.
My question is how can i repent, I have realized and asked with heart for forgiveness. Will I be forgiven ?