Electrocatalytic water splitting in an alkaline medium is recognized as the promising technology to sustainably generate clean hydrogen energy via hydrogen evolution reaction (HER), while the sluggish water dissociation and subsequent *H adsorption steps greatly retarded the reaction kinetics and efficiency of the overall hydrogen evolution process. Whilst nitrogen (N)-doped carbon-based materials are attractive candidates for promoting HER activity, the facile fabrication and gaining a deeper insight into the electrocatalytic mechanism are still challenging. Herein, inspired by the Diels-Alder reaction, we precisely tailored six-membered pyridinic N and five-membered pyrrolic N sites at the edge of the carbon substrates. Comprehensive analysis validates that the participation of pyridinic N (electron-withdrawing) and pyrrolic N (electron-releasing) will induce the charge rearrangements, and further generate local electrophilic and nucleophilic domains in adjacent carbon rings, which guarantees the occurrence of water dissociation to generate protons and the subsequent adsorption of *H intermediates through elec-trostatic interactions, thereby facilitating the overall reaction kinetics. To this end, the optimal NC-ZnCl2- 25 % electrocatalysts present excellent alkaline HER activity (l10 = 45 mV, Tafel slop of 37.7 mV dec-1) superior to commercial Pt/C. (c) 2022 Elsevier Inc. All rights reserved.