HC-06 problems...

Hi,
I recently bought a bluetooth module, an HC-06.
I successfully wired it and was able to turn an LED on and off with my phone,
but when I tie it with my macbook and try to program it wirelessly, the IDE says
programmer not responding.
Also sometimes the bluetooth module, even when connected, doesn't show up in the "ports" menu.

Help!

That is what is expected to happen. So no help needed.

Then how can I configure it so that I can program it wirelessly?

You can't, so use wires. You have two options, communication mode or configuration mode - one or the other, not both.

You might be able to use bluetooth control Arduino so that it can configure bluetooth by wires.