My '95 did the same thing. It was the Throttle position sensor.
why 1991 Chevy silverado misses out while under power
Fuel pump is my guess.
There is a problem with the charging system.
for starters, your fuel filter may be fouled.
While the truck is running in idle pull out the dip stick and read it.
It is on the back lower left side of the engine While standing in the front of engine.
its your pump
It could be a lot of different things, To be able to help you better need the year and engine size.
It should be idling at approximately 625 rpm while the engine is warm.
I know that on my 1998 Silverado, if I but the parking brake on, the fulltime headlites turn off while I'm sitting and idling.
possible transfer case encoder motor problem