I had something like that with my car (not diesel). When I stood still, the engine shook like a madman and sometimes even stalled. I just got to a garage and they look at it, turn off the engine, fiddle something under the hood (like 5 seconds) start up the car and it runs smoothly again. He looks at me and says "Was that the problem?".
Turned out to be that a vacuum hose shot loose. Now, I can fix it myself as it happens quite sometimes if I rev it too high and then suddenly let go of the clutch (yes, I am in a hurry then)
At first replace your fuel filter as Erik said. It could also be both the injectors or the pump itself. So filter -> injectors -> pump. Bad injectors can make your engine rattle and smoke badly. If it's not the case, it can still be the injectors. If it's the pump, well that won't be cheap. Depends on the car though.
Thanks. The filter was changed recently, so I don't think it is the case, unless some bad quality diesel clogged it. It actually idles nicely, but when driving the car trembles and lacks power until I let it gain some revs. I'll try replacing the injectors in first place, as the car is 21 year old and I doubt they've been ever changed, so it's time to do that anyway. The increase in performance should be more than noticeable.
Swapped the carb on Moskvich a couple of days ago, and the old airbox didn't fit, so consulted by friends, a couple of beers, two frying pans and some patience later we've got this. I must've fell on my head when I was a baby.
Anyway, as the majority of the engine bay is made from aluminium, I'm thinking of polishing everything someday, when I'm not as lazy. Or at least the UFO frying pan and cylinder head cover. Bling!