We have thought of thy loving-kindness - We went to thy temple to worship thee; we meditated on thy goodness; we waited for a display of it; and the panic that in the first instance struck us, was transferred to our enemies; and fear took hold upon them, they marvelled, were troubled, and hasted away.
We have thought of thy loving-kindness, O God - We have reflected on, or meditated on. The word used here literally means “to compare, to liken;” and this idea is perhaps always implied when it is used in the sense of thinking on, or meditating on. Perhaps the meaning here is, that they had “compared” in their own minds what they had heard from their fathers with what they had now seen; they had called all these things up to their remembrance, and had compared the one with the other.
In the midst of thy temple - See the notes at Psalm 5:7. The allusion here most probably is to the “temple,” properly so called, as these transactions are supposed to have occurred after the building of the temple by Solomon. The expression here also would make it probable that the psalm was composed after the defeat and overthrow of the armies referred to, in order that it might be used in the temple in celebrating the deliverance.