Through the parable of the Good Samaritan, Christ interprets “you shall love your neighbor as yourself” as meaning “whoever you love as yourself becomes your neighbor”. The commandment is therefore also an axiom about how the heart works. Neighbors are those we are near to, but the relevant sense of nearness is measured by the absence of discord and not of distance.
“Neighbor” or “the one near-by” is redefined in a way that need not be symmetrical. If I am close to you distance-wise, you are close to me distance-wise. But to be close in Christ’s sense is a closeness of the heart, and in this way you could be very close to me without me being very close to you. And so the command is to be a neighbor to all even if they are not to us, as God is neighbor to us even though when we are not to him.