My trucks motor will turn over but its takes awhile for it to fire and when it does it runs real rough for about 20 seconds. I've replaced the crankshaft sensor twice. When you get it started you can let it run for a minute and turn it off and it'll start right back up but if you let it sit awhile it'll mess up again. When you get it started its also not idling right. The RPMs just go to zero unless I hold down the accelerator.
The first thing I recommend checking is the fuel pump pressure. See if it is within the manufacturer's specs. Also, see if it is dropping off quickly when you turn the key off and if it is building pressure quickly when you first turn the key on.
As far as the idle issue, it could be a vacuum leaks, the idle air control valve. Wait to see what the fuel pressure turns out to be and then we can move on.