Rashi on the Former Prophets
2 Samuel 22
On the day Adonoy saved him. In his old age after all his troubles had passed and he had survived all of them.
And from the hands of Shaul. Shaul was part of the general grouping [of "his enemies"]? but he was his greatest enemy and pursuer. Similarly [we find], "Nineteen men and Asohel Similarly, "Go spy out the land and Yericho." And similarly, "King Shlomo loved [many] foreign women and [he loved] the daughter of Pharoah."
My Rock, my Fortress. They are words denoting strength. Rock is obvious in its connotation [of strengh]. Fortress is [a reference to] a fortress amongst the forests that is called flassant in O.F. It is [also] a reference to the miracle that occurred by the rock at the crossroads and the fortresses of the forest.
My Rescuer. He saved me when I was with Yisroel's army at war and other times He saved me when I was alone for example [He saved me] from (the inhabitants of Nov)[“Yishbi-Benov”].
My Rock. Language denoting a rock because a rock protects passerby from the rain and from the winds. Abriments in O.F.
I take refuge. Language denoting a covering that I was able to be protectively covered.
My Stronghold. He supported me.
My Refuge. I would run to him for protection.
I call to Adonoy in praise. As it is translated, when I called Him, I praised Him (with my mouth) because I trusted that I would be saved from my enemies. And it is possible to interpret the words אֶקְרָא and אִוׇּשֵׁעַ as being used in the present tense.
Surrounded me. Surrounded me.
Death's destruction. As [Yonoson] translates, "Like a woman sitting on the birthing chair," that is the name of the stone seat where women give birth.
The deluge. Soldiers pouring forth like a stream.
The agony. As [Yonoson] translates, "Groups," as [we find], "Group of prophets."
Were before me. Came before me.
In my distress I called to God… He hears. This is typical of the present tense it uses both past and future at the same time.
Shook and shuddered. This is not referring to the miracles that happened to him but to the miracles that happened to Yisroel and the beginning of the verse is connected to the end.
When God became angry. The word כי is being used here to mean "when," and this is its interpretation, when God became angry on account of his antagonists the world shook and shuddered and the pillars of heaven trembled and shook.
Smoke rose from His Nostrils. Such is the manner of an angry person, smoke comes out of his nostrils and so [we find], "Smoke has risen from My nostrils." This is always the meaning of the words "Anger of the nose," the nose flares and lets out air.
Fire from His Mouth consumed [the wicked]. Through the decree utterred from His Mouth fire [came forth] and consumed the wicked.
He bent heaven. To take revenge from His enemies, from Mitzrayim and from Pharoah.
He put [a protective] darkness around. For [protective] cover as it says, "The pillar of cloud and the darkness separated between Mitzrayim and Yisroel."
Abundant waters, thick clouds of the sky. From where did the darkness come? They came from thick clouds that sprinkle water on the earth.
Sprinkled. [This is] language that denotes a sieve, [the water] falls to the earth in small droplets. This [same language] is used in many places in Aggadah, "They dice it in a sieve," Some interpret חַשְׁרַת as denoting a binding, that the skies became bound up with clouds because of the water [in them] as [the word] "the spokes" used [in connection with] the wheels of a wagon. They are wooden spokes that bond and bind the wheel's perimeter together.
From the brightness before Him. You should not conclude that He dwells in darkness but rather it is light that is within the boundary and it is from that light that is before Him that the burning coals of fire [came forth]. [It is from there] that the arrows were shot at Mitzrayim.
The foundations of the earth were revealed. The deep seas split open. When the Reed Sea split all the world's waters split [as well].
By the wind. From the force of wind blowing from His Nostrils.
They were too powerful. When they were overpowering.
For my rightesnous. When they [the people of Yisroel] followed God into the desert and had faith in His promise.
To the Kind, Sincere, Pure. [These three nouns] represent the three Patriarchs. God paid the reward of their righteousness to their children.
And to those who are crooked. [This refers to] Paroh
You act perversely. [This is] language denoting jagged and crooked. In the book of Tehilim it is written, תִּתְפַּתָּל. An alternative explanation, [when writing] "He delivers [salvation] from on high," [Dovid] was refering to himself. When he was rushing to escape Shaul [and had reached] the rock at the crossroads, and was close to being captured an angel came to Shaul saying, "Go quickly because the Pelishtim have spread out [in battle formation over the terrain.]" "He rewarded me…according to my righteousness." [Refering to the fact] that I did not kill him [Shaul] when I [instead just] cut off the corner of his coat.
The word of Adonoy is clear. It is clear, He makes promises and keeps them.
He cleared my path to perfection. From any obstacle, from any sin and from any danger until there was peace and [the land was] conquered.
My arms to bend a copper bow. So that a copper bow can be bent by my arms because I have the strength to bend them. Dovid had bows hanging in his palace, and kings of other nations would come and see them and ask each other, Do you think that he can bend them? This is only to scare us. Dovid would hear them and would take them [the bows] and bend them in front of them [the kings]. The binding of a bow is denoted by the word חִתַּת and so [we find], "Your arrows have been shot into me".
You have been abundant for my sake with Your humility. You have been abundant for my sake, with Your humility.
You have expanded my stride. When a man keeps his legs together, it is easier for him to fall, and so it says, "When you travel, do not narrow your stride."
My ankles. My ankles.
They cried out there was no one to deliver them. The words of verse are not written in order [the proper order should be] "They will cry out to Adonoy but He will not answer them and no one will deliver them" as [we find], "Man will turn to his Maker", as if to say "turn". Menachem connected [the word יִשְׁעֶה] with [the verse,] "Adonoy listened to Hevel", and he [Menachem] interpreted it as "listening." This word can be used to denote both the listener and the listened to as [we find], "Yitzchok implored Adonoy… and Adonoy listened to him." So too here "They will implore [God] and they will not be saved" is a case where the word יִשְׁעוּ is refering to the one praying and "Adonoy listened…" is a case where the word is refering to the [Holy] One being prayed to.
I will trample them. I will trample them. There are many cases like this in the book of Yechezkiel, [such as] "You will trample with your feet" [and] "You trampled with [your] foot."
Antagonists. From Doeg, Achitophel, Shaul and the Ziffites.
You preserved me to be a leader of nations. He kept me hidden for this purpose. The Midrash Aggadah [interprets our verse], "Dovid said, "Master of the universe, spare me from [potential] judgement concerning [the people of] Yisroel for if I shall cause [Yisroel] to turn away [from You] or I rule them harshly during the course of my service I will be punished [by You]. Rather, make me the leader of the Pelishtim and let them serve me [because] I will not be punished on their account.
Lied to me. Out of fear they told me lies.
[As soon] as their ears hear [my wish] they listen to [and obey] me. Even when they are not in my presence they are fearful of me [to the point that as soon] as their ears hear [my wish], they move [to obey] my command.
Foreign people will wither. Will wither [Similar to] the language of "I will become withered". Pagisterant in O.F.
They will become lame. Lame people.
From [the agony of] their imprisonment. From the tortures of imprisonment that I will inflict upon them.
Adonoy lives. Who does all of this for me.
You arrive at the cited line; the whole work is yours to read around it. The text is set from the cited public-domain edition.