Rashi to the pasuk לא תקום explains that suppose you have person A who asks person B to borrow his jacket and he says no, and then the next day person B asks person A to borrow his jacket or something else and he says no, this is a case of revenge. But here Rashi uses a sort of middah k’neged middah sort of case- he didn’t lend you his jacket, so you won’t lend him yours. But suppose person B doesn’t give him his jacket to borrow, and now person A the next day decides to let’s say go out of his way to do something bad to person B, like tripping him, is that considered revenge? Person B doesn’t lend you his jacket, so you decide to punch him in the face, or key his car, or blah blah…is this not considered revenge? Because according to Rashi’s example it seems revenge is only if you dish out exactly what you were served, so to say.
The Chofetz Chaim in the Pesicha of Lavin number 9 says that one can violate this Lav even by just saying lashon hara about the person, so obviously it does not have to be “in kind”:
וְלִפְעָמִים שֶׁהַמְסַפֵּר עוֹבֵר גַּם כֵּן (ח-ט) עַל לָאו (ויקרא י"ט י"ח) דְּ''לֹא תִקֹם וְלֹא תִטֹר'', כְּגוֹן שֶׁיֵּשׁ לוֹ שִׂנְאָה עָלָיו עַל דָּבָר, שֶׁבִּקֵשׁ מִמֶנּוּ לַעֲשׂוֹת לוֹ טוֹבָה בִּדְבַר שְׁאִילַת מָמוֹן וְכַיּוֹצֵא בָּזֶה (כְּמו שׁכָּתַבתִּי בִּבְאֵר מַיִם חַיִּים, בְּשֵׁם הָרְאֵ''ם) וְלֹא הֵיטִיבוֹ, וַעֲבוּר זֶה נוֹטֵר לוֹ שִׂנְאָה בְּלִבּוֹ, וּכְשֶׁרוֹאֶה אַחַר כָּךְ עָלָיו שׁוּם דְּבַר גְּנַאי, מְפַרְסְמוֹ בִּפְנֵי אֲנָשִׁים. וְהוּא עוֹבֵר מִתְּחִלָּה עַל הַנְּטִירָה שֶׁבַּלֵּב, עַל לָאו דְּ''לֹא תִטֹר", וְאַחַר כָּךְ כְּשֶׁנּוֹקֵם מִמֶנּוּ, וְסִפֵּר עָלָיו עֲבוּר זֶה הַדִּבְרֵי גְּנוּת שֶׁרָאָה עָלָיו, עוֹבֵר עַל לָאו דְּ''לֹא תִקֹם'', אֶלָּא צָרִיךְ שֶׁיִּמְחֶה הַדָּבָר מִלִּבּוֹ
8-9) Sometimes the speaker also transgresses (Vayikra 19:18): "You shall not take revenge and you shall not bear a grudge, as when he [the speaker] bears hatred towards him, having asked him to lend him something and having been denied; and, thereafter, seeing something demeaning in him, he publicizes it before others. From the beginning, he transgresses "You shall not bear a grudge," by bearing the grudge in his heart. And later, when he takes revenge and reveals the demeaning thing he has seen in him, he transgresses "You shall not take revenge." But he must wipe the thing from his heart!