I like carrot / carrots

Hello.
When one likes some food in general, what form, plural o sigular should one use? For example:
I like carrot / carrots.
I like onion / oninons.
I gut feeling says that one should say “I like cabbage” (sg) and “I like straberry”, but “I like bananas”(pl) and “I like potatoes”
Is there any rule on this or the choice of form depends on a particular word which follows “I like…”?

Your choice should be based on whether the noun is countable or uncountable.
For instance:

I like carrots.
I like onions.
I like scrawberries.
I like bananas.

I like cabbage.
I like rise.
I like sugar.

Thanks a lot!

All these nouns could be countable or uncountable.
If you talk about the sort you should use singular.
I like cabbage, strawberry, banana, potato etc.

But

I can’t eat more than three carrots of middle size at a time.

The sentence you wrote is incorrect, it should read:
I like strawberries, bananas, potatoes.
The reason is as I’ve explained it above.

Simply put, you can count strawberries, so you either have to say “a strawberry” (one berry), or strawberries (collectively). Obviously, when you say “I like strawberries”, you’re not referring to one berry.
Though you can say “I like strawberry jam”.

One question more. Are there any exceptions to the rule? For example, “pizza” is countable, at least according to my dictionary, but there are many hits in google for “I like pizza”. The only explanation I can think of is that the rule you mentioned applies for food while “pizza” is rather a dish, like “vegetable soup” and the correct way to say will be “I like vegetable soup”. Right? Or am I on the wrong track?

Sounds reasonable enough to me, Pechorin.

Thanks a lot!