What code editor to use is always a matter of personal preference, but here are some things to think about when picking the right editor for pig.
You don't necessarily need to write your UDFs in the same editor that you write Pig, but having everything in one place can be handy. An extensive list of editor extensions for Pig can be found here. Below are a couple of suggestions for environments compatible with Pig development.
Vi has been around for nearly 30 years, and its more aesthetically pleasing stepchild Vim has been around for 20. Vim is free and minimalist, with a Pig syntax hightlighting file available here.
On the other end of the spectrum, JetBrains provides full-featured IDEs tailored to particular languages. Of most interest to a Pig developer are Intellij (Java + everything) and PyCharm (Python). Though they offer more syntax feedback the languages they primarily target, the Pig support is roughly equivalent to any of the text editors available.
To install the Pig plugin, download from here. Under Preferences->Plugins, select "Install plugin from disk..."