Recently I ran into some vim issues while ssh’ing onto a windows server running cygwin… the process of getting things to work right was painful enough for me to do a write up.
To be more explicit, this was my situation : I was working on a mac laptop ssh’ing onto a windows machine running cygwin and using vim to edit files.
Here were the list of issues that I ran into and how I was able to address them :
SSH terminal window had a grayish color surrounding all text
To fix this I had to explicitly set the terminal type. I am not an expert on terminal types, and not really interested in becoming one, so all I can offer in this post is what worked for me, and that setting it to vt100.
If you are unclear on how to set the terminal type, it is an environment variable that be set in either your .profile or manually in the mac terminal by using the following command :
Or open up the mac terminal preferences -> Settings -> Advanced -> under “Emulation” select vt100
VIM issue with Delete not working outputting “^_”
What was happening here was that mac sends a different command for backspace than windows uses. This was took a few google searches but was able to track down the fixes for this issue.
1. Edit Terminal Preferences : Open up the mac terminal preferences -> Settings -> Advanced -> check “Delete sends Ctrl-H”
2. ssh onto the windows machine running cygwin and add the following to the .vimrc file in your home directory :
These two things made vim work as expected while ssh’ing onto windows machine running cygwin.