This is what I do...maybe it will help some of you...
First I pin the zipper to the fronts of the cardigan. (Keep the zipper closed) Then I make sure I can open and close it and maybe even try it on.
Now I baste the zipper in place. (hand sew long stitches that you can easily remove...basically it does the same thing as the pins.) This way you don't have to deal with the pins as you sew it in.
Now I sew the outter edge of the zipper to the inside. I usually line it up with a column of stitches and then stick to that same column all the way up.
Turn it right side out and sew up the center of the zipper. Be sure you don't go too close to the zipper teeth...you want to make sure the zipper will actually work!
And voila...the zipper is in. (you can now pull out your basted stitches if you like)
I have had much success at sewing in zipper by machine on dresses...but I have yet to put my knitting under a zipper foot...fear, it's just pure fear people.