Apart from the obvious suggestion to take frequent breaks (and get some sleep, because the code you write in 18-hour coding sessions unfortunately tends to look like it was written in such a session), you'll probably need to address the whole set of ergonomic issues.
Namely, desk height, monitor height, are you sitting right in relation to your desk etc.
Keyboard-wise, I had a nerve injury in my left arm several years back and returning to a full-time programming career looked rather grim as I wasn't (and am still not really) able to use a standard keyboard for more than a couple of hours a day.
What saved my career was that I discovered the Kinesis Ergo contoured keyboard. These are a tad more "extreme" compared to, say, the MS Ergonomic offerings but they are miles ahead in comfort stakes once you get used to them. Getting used to them takes a little while (shorter if you can already touchtype, otherwise you'll learn that very quickly) and I'm not a big fan of the squishy row of function keys a la ZX Spectrum from the mid-eighties, but they work well enough for me that I now own several for the various machines I work on - and they're paid for out of my own pocket, which given the price should give you an idea as to how highly I rate them.