Longformacus is the largest of the villages in the Lammermuir CC area. It is around 10 kilometres (6.2 mi) north-west of Duns. The Dye Water runs through the village, flowing east towards its confluence with the Whiteadder Water nearby. The Southern Upland Way, a Long Distance Route which crosses southern Scotland, passes through the village, and the Sir Walter Scott Way from Moffat to Cockburnspath passes through Longformacus.
Longformacus may derive its name from the Gaelic ‘Longphort Mhacais’, meaning ‘Macas’s camp’. Derivation from ‘Lann Fothir Maccus’, meaning ‘church on the land of Maccus’ has also been suggested. The church of Longformacus was dedicated by Bishop David de Bernham, 11th March 1243. In 1667 it was recorded as being in ruins and was rebuilt on the old foundations in 1730. A thorough renovation was undertaken in 1895. Our Lady’s Well is on the Dye Water, about a quarter of a mile east of the village. The parish was long united to Mordington but was disjoined in 1666. Longformacus and Ellem were united in 1712; and Ellem church then became disused.