A facile strategy to construct the N-enriched hierarchically porous carbon nanosheets was developed while the bis-vinylimidazolium based poly(ionic liquids) (PIL-Ac) served as ideal carbon precursors and zinc acetate (Zn(Ac)2) as a potent template based on Zn(Ac)2/PIL-Ac coordination interaction. Interestingly, the pore structure of PNCs could be tailored by the amount of Zn(Ac)2 during pyrolysis process. Briefly, the hierarchically porous structure (micropores/mesopores) appeared when the mass ratio of Zn(Ac)2/PIL-Ac was greater than 1, or else the microporous structure. It was mainly attributed to that the existence of more ZnO and gases would generate more pore channels after thermal and acid-etching treatment, which could occupy a portion of pore spaces or etch the carbon frameworks during carbonization. It was clearly that acetate anions from Zn(Ac)2 or PIL-Ac had profound effects on pore-forming besides Zn2+. Moreover, the obtained PNCs adsorbents took the advantages of large specific surface areas (1010–1354 m2·g−1), high N contents (4.91–7.06 wt%) and fine-turning micropore sizes (0.54–0.91 nm). Among them, PNC-1 exhibited the best CO2 adsorption capacity of 2.50 mmol/g at 25 °C under 1.0 bar, and it was around 2.58 and 5.45 times higher than those of NC-Ac and NC-Br directly derived from PIL-Ac and PIL-Br, respectively. It was mainly owing to its largest surface area, relatively higher N content (6.47 wt%) and cooperative effect of micropores/mesopores. The hierarchically porous architecture played a key role in the CO2 capture process, specifically the mesoporous passageways served as continuous tubes to transfer CO2 molecules fast and conveniently, while micropores provided adequate accommodations for CO2 storage. Furthermore, the good CO2/N2 selectivity, stability and reusability of PNC-1 could make it one of the promising candidates for CO2 capture.