Added some conditional logic for gvim vs. vim

Note: this still needs a *lot* of work.
Improved performance for gvim vs. vim