In the typical ionothermal synthesis of crystalline carbon nitride (CCN), alkali metal halides are usually used in large amounts. Here, we report a new method for synthesizing poly (heptazine imide) (PHI) using only a trace amount of NaF, which is 20 times less than the amount of NaCl typically required to achieve the PHI structure. Different from the prevailing view that salts function primarily as templates and chelating agents during polymerization, our research revealed the unique role that NaF plays in the polymerization of PHI. We propose a new formation mechanism, termed the "pinning-docking mechanism," in which fluoride (F) atoms and bidentate nitrogen atoms (N) coordinated to sodium (Na) atoms build a strong triangle configuration that synergistically promotes the formation of PHI. Calculations indicate that the highly electronegative F atom generates an effective electron flow within the N-metal-F complex, causing local electron reorganization and accordingly activating the N sites for H