I prefer to keep things simple and I don't mind paying for the convenience of someone bringing me food. So I usually tip 20% on the total bill, same as I would tip at a sit-down restaurant. It probably won't be exactly 20% because I don't like fooling with a bunch of coins, so $2.34 might get rounded up to $2.50 for example. If it's raining or something, $3.00 (i.e., a bit higher still). If they are super-slow or otherwise don't give good service I start taking money away from what I've set aside for the tip.
I can't do math quickly in my head so I have to figure out beforehand what 20% would be, then go up or down from there in small increments based on weather, service, etc. so I don't either short someone, or give a massively overinflated tip.
I usually order my food online and most restaurants explicitly state that the "delivery charge" does NOT go to the driver at all. So I figure my 20% tip based on the total, final amount that I am required to pay (food charge + tax + delivery charge).