For the director of music. A psalm of David.

1 aIn you, LORD, I have taken refuge; let me never be put to shame; deliver me in your righteousness.
2 Turn your ear to me, come quickly to my rescue; be my rock of refuge, a strong fortress to save me.
3 Since you are my rock and my fortress, for the sake of your name lead and guide me.
4 Keep me free from the trap that is set for me, for you are my refuge.
5 Into your hands I commit my spirit; deliver me, LORD, my faithful God.
6 I hate those who cling to worthless idols; as for me, I trust in the LORD.
7 I will be glad and rejoice in your love, for you saw my affliction and knew the anguish of my soul.
8 You have not given me into the hands of the enemy but have set my feet in a spacious place.