Here is the intorduction to Psalm 18.
To the choirmaster. A Psalm of David, the servant of the Lord, who addressed the words of this song to the Lord on the day when the Lord delivered him from the hand of all his enemies, and from the hand of Saul.
(David celebrated his deliverance from the hand of his enemies and from the hand of Saul. Even though Saul had often tried to kill him, David apparently didn’t consider him an enemy.)
David begins the psalm by describing past troubles when his life seemed to be in danger. He called to God for help and God rescured him and gave him victory over his enemies. He said that God delivered him because of his righteousness. Read the rest of this entry