Gilmer was born in Guilford County, North Carolina near Greensboro. His parents were Robert Shaw Gilmer and Anne Forbes. He was the brother of ConfederateMaj. GenJeremy Francis Gilmer. Gilmer attended the public schools and an academy in Greensboro. After receiving his education, he taught school. He then studied law and was admitted to the bar in 1832 and began practice in Greensboro. He later served as the Guilford County solicitor. He was a member of the State senate from 1846 to 1856. In 1856, Gilmer was the Whig candidate for Governor of North Carolina but was defeated. He was elected as the candidate of the American Party to the Thirty-fifth Congress and reelected as a candidate of the Opposition Party to the Thirty-sixth Congress (March 4, 1857-March 3, 1861). During the Thirty-sixth Congress he was the Chairman of the Committee on Elections. After secession he served as a member of the Second Confederate Congress in 1864. He served as a delegate to the Union National Convention of Conservatives at Philadelphia in 1866. Gilmer died in Greensboro, North Carolina and is interred in the Presbyterian Church Cemetery.