Trimble first saw combat as part of Thomas J. "Stonewall" Jackson's spring 1862 campaign in the Shenandoah Valley. He distinguished himself in the Battle of Cross Keys by fighting off an attack from Union troops under Maj. Gen. John C. Frémont, and then seizing the initiative to counterattack and rout them. During the Seven Days Battles under Jackson outside of Richmond, Virginia, his brigade had few engagements, but they fought hard at Gaines' Mill and he sought to follow up the unsuccessful Confederate assault on Malvern Hill by making a night attack, but his request was refused.