The Edinburgh festival running there at the moment including the fringe and comedy festivals and of course the world famous military tattoo will be running nightly.
Google it and you'll find there will be an absolute mass of good and crap, free and pay to attend shows, bars open till 3am and clubs till 5am.
Just a Civvy is right. lots to do as the Edinburgh Festival is on, so there will always be something that floats your boat if you can bear all those hippy folk . There are more bars & pubs than you can throw a stick at. The Jolly Judge in one of the closes on the Royal Mile is a great wee pub. Yesterday I went to see a bit of stand up comedy in a bar called WhistleBinkies(Jack Daniel's Music Bar) on Niddry Street which is also worth a visit. The Jekyll and Hyde in Hanover street (just off Princes street) has free comedy and is in the style of Gothic/haunted crypt.