I'd like to ssh to a remote server and vim a file.
I tried
ssh -t user@host "vim x"
which gave me errors:
Error detected while processing /home/michael/.vimrc:
line 58:
E538: No mouse support: mouse=a
line 91:
E474: Invalid argument: listchars=tab:▒~V▒\ ,eol:¬,trail:▒~K~E,extends:▒~]▒,precedes:▒~]▒
line 158:
E185: Cannot find color scheme solarized
line 289:
E484: Can't open file /home/michael/.vimrc_machine_specific
Press ENTER or type command to continue
and so of course the vim window was not properly configured when I entered it.
These errors are from the server's .vimrc, /home/michael/.vimrc . The last one is especially surprising, as it is generated by a try/catch that shouldn't cause an error:
try
source ~/.vimrc_machine_specific
catch
" No such file? No problem; just ignore it.
endtry
If I ssh to log in to the server and then type 'vim x', all works correctly -- the colorscheme loads, the missing .vimrc_machine_specific is quietly ignored, the mouse works, etc.
Local machine:
- Cygwin on Win7
- ssh version:
OpenSSH_5.1p1, OpenSSL 0.9.8o 01 Jun 2010
Remote machine:
- uname -a:
Linux <hostname> 2.6.32-220.2.1.el6.x86_64 #1 SMP Fri Dec 23 02:21:33 CST 2011 x86_64 x86_64 x86_64 GNU/Linux
- ssh version:
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
- vim version:
7.2 (2008 Aug 9), including patches 1-411, Huge version without GUI.
Any idea what I'm doing wrong?
.vimrc
file.