How do I steal from a shopkeeper?
Here is an almost fail-safe newbie-friendly idiot-proof procedure to rob the shopkeeper using a bomb and a rope:
Find a shop to rob.
Attach a rope outside the entrance.
Pickup an item and carry it to the rope. The shopkeeper will follow you.
Climb up the rope so that the shopkeeper stands in front of the rope.
Climb down and place the item in the entrance.
Apply bomb to shopkeeper.
Profit.
If there's a shotgun, freeze ray, or machete, simply pick it up and attack the shopkeeper with it. Wait for the shopkeeper to step towards you so you have room to maneuver, or room to jump on his head in the case of the freeze ray.
There's also a method (in Spelunky HD only, apparently) that allows you to reliably rob shopkeepers safely with only a whip. Jump against the wall above the shopkeeper, whip while falling down, and grab the shotgun before he wakes up. Throwing the shopkeeper before grabbing the shotgun can buy you some more time. BananasaurusRex goes over it with more details in the youtube below.
Source:
This particular technique only works in the 3rd world, the ice cave.
Step 1: Find one of the proximity mines.
Step 2: Pick up proximity mine
Step 3: Go to shop
Step 4: GENTLY place the mine next to the shopkeeper
Step 5: Run away. Run as fast as you can.
Shopkeepers, for some reason, perceive whipping anywhere near them as a threat, but dropping a high-yield explosive device on their face is no big deal. The shopkeeper will explode without even having a chance to yell at you.