Chop the onion and thinly slice or shred the cabbage.
Heat the oil in a pan, sauté the onion until soft, then add half of the cabbage, sugar and vinegar. Under cover, simmer at low heat for 15 minutes.
In another pan of lightly salted, boiling water cook the pasta according to the package instructions. For the last 5 minutes add the remaining cabbage.
Coarsely chop the walnuts and fry them in a non-stick frying pan, with no oil, until toasted.
Drain the pasta and cabbage, transfer to a serving dish. Add the braised cabbage, walnuts and herb. Season with salt and pepper.
Serve warm with some grated Parmesan cheese if you like.