You should avoid buying a bunch of perishable items unless you have specific plans on when to use them. Onions and peppers typically will last in a refrigerator for about a week before the peppers start to shrivel in appearance and the onion begins to get soft spots. Herbs, especially cilantro and parsley, usually last about 3-4 days before they start to brown and get soggy. This is all speaking from my own experience. I did no research to discover this!
As far as purchasing items that have extremely long shelf lives, the following list is my definition of "the best" on-hand ingredients. I use all or most of these in many of my recipes and I have found that keeping my fridge and pantry stocked with these items makes it so easy to create, substitute, and even change up other recipes.