Injectable hydrogels provide a promising strategy to fill the irregular cystic cavity in spinal cord injury. However, a simple and convenient functionalization approach of injectable hydrogels is still a huge challenge. Herein, we report a facile in situ synthetic strategy of injectable lysine-contained peptide functionalized hydrogels for the treatment of spinal cord injury. The ibuprofen-KYIGSRK conjugated hydrogels are in situ synthesized via in situ Michael addition without catalysts and additional reaction-steps. Ibuprofen-KYIGSRK conjugated soft hydrogels promote the adhesion and neurite extension of DRG neurons by upregulating of Sall3, Pou3f3, Lhx5, Shank1 and Sall1. The long-term implanted ibuprofen-KYIGSRK hydrogel is injected into the spinal cord injured site for promoting motor functional recovery. Increased neurites and decreased glial scars are detected with effective functional improvements in footprint. This injectable hydrogel can not only fill the irregular cavities for inhibiting the glial scar formation, but also significantly suppress inflammatory responses and promote nerve regeneration. This study supplies a convenient in situ synthetic route of injectable peptide functionalized hydrogels for the treatment of spinal cord injury or other biomedical applications.