Aminovinyl-cysteine residues arise from processing the C-terminal L-Cys and an internal L-Ser/L-Thr or L-Cys of a peptide. Formation of these nonproteinogenic amino acids, which occur in a macrocyclic ring of diverse ribosomally synthesized lanthipeptides and non-lanthipeptides, remains poorly understood. Here, we report that LanD-like flavoproteins in the biosynthesis of distinct non-lanthipeptides share an unexpected dual activity for aminovinylcysteine formation. Each flavoprotein catalyzes oxidative decarboxylation of the C-terminal L-Cys and couples the resulting enethiol nucleophile with the internal residue to afford a thioether linkage for peptide cyclization. The cyclization step, which largely depends on proximity effect by positioning the enethiol intermediate with a bent conformation at the active site, can be substrate-dependent, proceeding inefficiently through nucleophilic substitution for an unmodified peptide or efficiently through Michael addition for a dehydrated/dethiolated peptide. Uncovering this unusual flavin-dependent paradigm for thioether residue formation advances the understanding in the biosynthesis of aminovinyl-cysteine-containing RiPPs and renews interest in flavoproteins, particularly those involved in non-redox transformations. LanD-like flavoproteins activity, which is flexible in peptide substrate and amenable for evolution by engineering, can be combined with different post-translational modifications for structural diversity, thereby holding promise for peptide macrocyclization/functionalization in drug development by chemoenzymatic or synthetic biology approaches.