Thank you for your question. In general, when a person loses vision spontaneously it is a medical emergency that requires immediate treatment. It is frequently a sign of a stroke, or at least a transient ischemic attack, which stems from many different causes. Amaurosis Fugax is the medical term that is used for sudden loss of vision in some cases, and is quite serious. Your specific situation seems to be a bit different, as you state that you have been having it for some years at this point. Until you have spoken to a doctor
who tells you otherwise, you need to manage this appropriately by speaking with a doctor, even if that means going to the emergency room.
Now, the fact that you say that your vision seems to dim from the outside in can also be a good piece of information, as there are many people that can describe this sort of symptom before they black out. This would be known as a syncopal episode if you were to fully pass out, and is also something that you should discuss with your doctor to determine a cause. Please speak with your doctor about your question and your symptoms.