Arduino write/handle long programs
Have you tried Atmel Studio? Right now, it only supports Windows but is a great alternative to Arduino IDE. 

If you're not comfortable using Windows virtual machine, I suggest you have a look at this: http://playground.arduino.cc/code/eclipse