When I lived in SF last (2 - 3 years ago), groceries were inexpensive in comparison to rent and eating out. I think my girlfriend and I spent around $200 per month on groceries (shopping at a Safeway in the financial district) vs $2.1k for rent and $50 - 100$ every time we went out for a decent meal. If you want to be in the city and save money by cooking it does make a big difference.
About how expensive are groceries? Most of the posts here only really mention rent, which isn't enough to fully describe cost of living.