Vinyl-bearing triazine-functionalized covalent organic frameworks (COFs) have emerged as promising materials for electrocatalysis and energy storage. Guided by density functional theory calculations, a vinyl-enriched COF (VCOF-1) featuring a donor–acceptor structure was synthesized based on the Knoevenagel reaction. Moreover, the VCOF-1@Ru without pyrolysis was obtained through chemical coordination interactions between VCOF-1 and RuCl3, exhibiting enhanced electrocatalytic performance in the hydrogen evolution reaction when exposed to 0.5 M H2SO4. The results demonstrated that the protonation of VCOF-1@Ru enhanced the electrical conductivity and accelerated the generation of H2 on the catalytically active site Ru. Additionally, VCOF-1@CNT with a tubular structure was prepared by uniformly wrapping VCOF-1 onto carbon nanotubes (CNTs) and using it as a cathode for lithium–sulfur batteries by chemically and physically encapsulating S. The enhanced performance of VCOF-1@CNT was attributed to the effective suppression of lithium polysulfide migration. This suppression was achieved through several mechanisms, including the inverse vulcanization of vinyl on VCOF-1@CNT, the enhancement of material conductivity, and the interaction between N in the materials and Li ions. This study demonstrated a strategy for enhancing material performance by precisely modulating the COF structure at the molecular level.