Eye twitching can sometimes be associated with deficiencies in certain vitamins and minerals, including magnesium and vitamin B12. Ensuring an adequate intake of these nutrients through a balanced diet or supplementation, as advised by your healthcare provider, may help alleviate eye twitching.