I would totally recommend vim... as it will help a lot of this! Also, look into something that will auto-close your parenthesis, square brackets, and curly brackets for you... I have something in vim that does this and it helps with this type of problem because I'm already inside the parenthesis.