I hate VI!

I think your problem is more with vi being an interactive editor which does not work very well in the type of reverse shell that you have. If you cannot get a fully interactive shell (e.g. through ssh) the tips from the other posters above are very useful.
If you simply want to add some lines to a new or existing file, you can also try “echo >> filename”. To replace existing lines you can use bash/sed magic.