In a saucepan over medium heat, soften the onion in the oil. Season with salt and pepper. Add the vinegar, water, sugar and fruit. Bring to a boil and simmer gently until the liquid is syrupy, about 15 minutes. Remove from the heat and add the vanilla. Let cool, then refrigerate.