We did it in the 1990's.
A railgun firing a plasmak (ball lightning) that is. Since the plasma is electrically conductive you can use it as both the armature and projectile. Muzzle velocity is insanely high, the projectile hits pretty hard just due to the speed, and as the plasmak impacts an object and is destroyed it releases a localized EMP - so the Star Wars ion cannon was actually not that far off. The big drawback is that the ball lightning disintegrates in a pathetically short distance in atmosphere, the structure is too unstable. In space however, you could get more respectable range out of this type of weapon.
Use a rail gun where one rail is an inner cone and the other rail is the outer cone. A donut of plasma between the cones acts as the armature/projectile. As it's forced out, it forms a stable(ish) structure called a field-reversed configuration which works exactly like a smoke ring - it's rotating about it's axis and rotating so that the inside of the ring moves forward and around to become the outside of the ring. This semi-stable plasma ball is ball lightning.
See also:
MARAUDER the Air Force Research Lab railgun plasma weapon.
General Fusion's Plasma Injectors (the largest in the world) use the same type of design. Definitely check out this paper as it breaks down the basic design. Their research library is full of all kinds of cool stuff.
This one is a bit different, but is also a type of plasma weapon. The US Army used a pulsed laser to create an ionized path in the air and paired it with a tesla coil. Lightning follows the path of least resistance through the air, so paint a target with the laser then blast it with lightning!