What the vinegar does is often called a conversion coating. Paint does not adhere well to pure metals. Conversion coatings are those whose chemicals convert the surface of a metal to a compound. Of course, air itself oxidizes many metals, but the oxides of many metals are not that great as a base for paint- the oxide does not stick well enough to the metal beneath it.
Vinegar is acetic acid, which really etches and converts the metal surface. However, most vinegar has a lot of impurities in it that are not that great. Used to be, photographic stop baths were widely available and were much purer form of acetic acid. Pure acetic acid is harder to find these days, but is better if you can find it. By pure, I mean just the acid and water dilutant. Literally pure acetic acid is very strong and a bit dangerous- well diluted acid is fine.
Brass blackening solution works well, and is available at many hobby shops. The resulting surface often is kind of flakey, and I recommend burnishing to get the residue off. If you need a black color, you are done after the blackening, but the thin black coating that remains will prime and paint well for other colors.
Some of the good metal primers contain chemicals that create such a conversion as part of the priming. However, it turns out that some of those compounds are carcinogenic, so those primers are not readily available any more.