I tend to spread my code over many files (if properly organized, it helps to find procedures quicker).. so I almost always have like four or five editors open... I then add to that some terminals.. some with man pages, other with temporary scripts to test the output of stuff etc..
I also like to spread all those windows across my 4 virtual desktops...
and every hour or so, when it became to confusing and unorganized, I just close every window on screen and start anew
and as for music.. that's mostly metal stuff.. so everything that's loud. somehow that helps me concentrate on the task at hand and not distracts me from things that happen out on the street..
that's all with headphones cause I'm mostly programming at night and don't want to wake the whole block
came to think about it, I'm just lucky to program just for fun and not in an business environment
Mat