All fighting related verses in the Quran are definitely self-defence, with the exception of only 1 verse. I’ll go over both cases, since the linked article doesn’t.
The nature of the opposed “fighting” in the Quran, ranges from being killed towards persistent persecutions of any sort, typically from an external entity.
Firstly, it should be noted that war, killing and fighting is generally regarded and seen as negative in Islam. It is even 1st presented as such in creationism.
Q (2:30): And, when your Lord said to the angels, “Indeed, I will make upon the eartha successive authority.” They said, “Will You place upon it one who causescorruption therein and sheds blood, while we declare Your praise and sanctify You?” Allah said, “Indeed, I know that which you do not know.”
Q (5:28): “If you should raise your hand against me to kill me – I shall not raise myhand against you to kill you. Indeed, I fear Allah, Lord of the worlds.
Q (28:15): “And the one from his faction called for help to him against the one from his enemy, so Moses struck him and killed him. He said, “This is from the work ofSatan. Indeed, he is a manifest, misleading enemy.”
Q (5:32): “whoever kills a soul unless for a soul or for corruption in the land – it is as if he had killed mankind entirely.”
Thus, the degree of sin in committing the act of murder, is highlighted.
Legally, murder is a crime, subject to the death penalty, unless forgiven.
Q (25:68): And those who do not invoke with Allah another deity or kill the soulwhich Allah has forbidden, except by right, and do not commit unlawful sexual intercourse. And whoever should do that will meet a penalty.
Externally, despite violence being a hated & unwanted of a thing – it is itself occasionally necessary in certain circumstances of war; an undeniable reality.
Q (2:216): Fighting has been enjoined upon you while it is hateful to you. But perhaps you hate a thing and it is good for you; and perhaps you love a thing and it is bad for you. And Allah Knows, while you know not.
Examples of use of violence in self-defence:
Q (22:40–41): Permission has been given to those who are being fought, because they were wronged. And indeed, Allah is competent to give them victory. Those who’ve been evicted from their homes without right – only because they say, “Our Lord is Allah.” And were it not that Allah checks the people, some by means of others, there would have been demolished monasteries, churches, synagogues, and mosques in which the name of Allah is much mentioned….”
Q (2:190): Fight in the way of Allah those who fight you but do not transgress. Indeed. Allah does not like transgressors.
Q (2:193): Fight them until there is no persecution and worship is for Allah. But ifthey cease, then there is to be no aggression except against the oppressors.
Q (4:75): And what is with you that you not fight in the cause of Allah and the oppressed among men, women, and children who say, “Our Lord, take us out of this city of oppressive people and appoint for us from Yourself a protector…
Q (4:90–91): Except for those who take refuge with a people between yourselves and whom is a treaty or those who come to you, their hearts strained at fighting you or fighting their own people. […] So if they remove themselves from you and do not fight you and offer you peace, then Allah has not made for you a cause against them. […] So if they do not withdraw from you or offer you peace or restrain their hands, then seize them and kill them wherever you overtake them. And those – We have made for you against them a clear authorization.
Q (8:61): And if they incline to peace, then incline to it and rely upon Allah.
Those who are peaceful or in a treaty, cannot be acted violently against. Use of violence on non-combatant/aggressors (innocents) is seen as transgression.
Moving onto a case of defence, that is often famously presented as offensive; i’ve re-arranged the verses, so as to make the context seem a bit more evident.
(9:13): Would you not fight a people who broke their oaths and determined to expelthe Messenger, and they had begun the attack upon you the first time?
(9:10): They do not observe toward a believer any pact of kinship or covenant of protection. And it is they who are the transgressors.
(9:8): How, while, if they gain dominance over you, they do not observe concerning you any pact of kinship or covenant of protection?
(9:1): A disassociation, from Allah and His Messenger, to those with whom you had made a treaty among the polytheists.
(9:7) How can there be for the polytheists a treaty in the sight of Allah and with His Messenger, except for those with whom you made a treaty at al-Masjid al-Haram? So as long as they are upright toward you, be upright toward them.
(9:3) And an announcement from Allah and His Messenger to the people on the day of the greater pilgrimage that Allah is disassociated from the disbelievers, and His Messenger. So if you repent, that is best for you; but if you turn away – then know that you will not cause failure to Allah..
(9:5): And when the sacred months have passed, then kill the polytheists wherever you find them and capture them and besiege them and sit in wait for them at every place of ambush. But if they should repent, establish prayer, and give zakah, let them on their way. Indeed, Allah is Forgiving and Merciful.
(9:4): Except for those with whom you made a treaty among the polytheists and then they have not been deficient toward you in anything or supported anyone against you; so complete for them their treaty until their term. Indeed, Allah loves the righteous
(9:6): And if any one of the polytheists seeks your protection, then grant him protection so that he may hear the words of Allah. Then deliver him to his place of safety. That is because they are a people who do not know.
(9:12): And if they break their oaths after their treaty and defame your religion, then fight the leaders of disbelief, for indeed, there are no oaths to them; they might cease.
(9:11): But if they repent, establish prayer, and give zakah, then they are your brothers in religion; and We detail the verses for a people who know.
So as we can see, the verse is dealing with defence against perpetual treaty violators. Treaties are literally a formal resolution for peace – that Muslims entered with the pagan Arabs (of Mecca). Anyone of them who holds a treaty and does not break it, or asks for an asylum/refuge is granted complete peace. As for those who repeatedly violate their covenant to the unjust detriment of the Muslims – God sanctions a way of stopping these transgressors/oppressors to end their violence. Pagan Arabs specifically must convert or die; the strongest use of violence in defence, against a long-time oppressive and later, treacherous people.
The following is the 1 & only offensive verse that exists. The Arab Muslims are in control of the Arabian peninsula – juxtaposed against Byzantine Christians & Sassanian Persians. This is the last violent verse, establishing a foreign policy.
Q (9:29): Fight those who do not believe in Allah or in the Last Day and who do not consider unlawful what Allah and His Messenger have made unlawful and who do not adopt the religion of truth from those who were given the Scripture – until they give the jizyah tax willingly while they are humbled.
As we can see, the Quran here at a given social development and particular stage of power is invoking the notion of conquest/expansionism. Islam, as a religion for mankind is extending its social order & way of life over everyone so that they are able to observe what God’s governance, justice and standard of morality is. This entails the spread of Islam as a political entity and not as a religious entity. All religions can perfectly coexist with Muslims.
It’s a fact that some of thewere peaceful & aided by non Muslims.
The verse does not state kill – ‘fight’ against other elite powers – its initiation requires a Muslim leader. Non-Muslim residents under Islamic rule, pay the state a tax for its protection of affairs (usual); Muslims also pay their taxes. The non-Muslim tax applies only to adult males, which they can ransom for with participation in the Islamic army (which they are exempt of). In history, Islamic empires where the most religiously diverse ever in the world. In Islam, non-Muslims are guided to Islam by preaching; forced conversions are prohibited.
Q (2:256): There shall be no compulsion in the religion. The right course has become clear from the wrong.
Q (16:106): Invite to the way of your Lord with wisdom and good instruction, and argue with them in a way that is best…
Q (21:107): And We have not sent you, except as a mercy to the worlds.
Q (10:25): And Allah invites to the Home of Peace and guides whom He wills to a straight path