Open MacVim via Terminal when SSH'ed to a server
I'm wondering if there is a way to have MacVim become my default editor when I've SSH'ed into a server. Is there any way for the server's .vimrc file to launch a program on my Mac?
I ask because occasionally I'll be getting some help from our programmer on a proje开发者_C百科ct, and if he logs into my account from his computer and opens vim using my configuration the color scheme is usually pretty harsh since he isn't using a terminal that supports 256 colors. Would it be easier to have my .vimrc file set up so if it detects a gui (e.g., I'm using iTerm instead of Terminal.app) it loads the colorscheme I prefer?
Thanks for any advice!
Here's a way to use MacVim to edit files on your server, but it requires you to start MacVim on your local computer first.
First make sure you have netrw
installed. Check :help netrw
to confirm that it is.
Then after you start MacVim, you can type something like this:
:e scp://username@yourserverdomain.com/.bash_profile
And you should see the file open up in your MacVim vim session. Edit it and save.
Having ssh keys set up to automatically authenticate you into the server will help.
精彩评论