Isn't everything much easier with the Arduino IDE?
I have mine set to use an external editor (Gedit, in my case).
...R