I can't think of a way to do what you want, but an alternative
solution would be to use your own vimrc on the remote server.
Create your own vimrc and give it a unique name such as
~/.vimrc.your_name. Then at the start of each PuTTY session,
execute
alias vim='vim -u ~/.vimrc.your_name'
See
:help -u
Regards,
Gary
I'm not sure what you mean by "it need to switch from putty to gvim". I
would've thought that gvim would be running in its own window and putty
in its own separate window, so switching between them is an o/s mousy
thing. You should be able to simply leave the gvim window up and
running, and so not need to type ":e scp://..." repeatedly.
Or perhaps you should try
:e scp://somehost/
(note the trailing slash) and "edit" the remote directory. Pick a
file, edit it, perhaps :w it; use :Rex to return to the netrw
directory listing, etc.
Regards,
Chip Campbell
Theoretically, it is possible, you can write some daemon app which
listens in your local computer, and a client utility which run in your
remote server.
When you execute a command in your remote server, it communicates with
the daemon app in your local computer, and the local app calls gvim
--remote-silent to do what you want, and then switch the focus into
your local gvim.
You need to write a simple client/server socket app to do this, which
could be less than 100 lines.
But IMO the better way is to define your own .vimrc in the remote
computer and launch vim with "vim -u .vimrc.yours", you can redefine
the 'rtp' in .vimrc so that the .vim directory can be your own
directory. you can create an alias for that.
vim scp://hostname/path/file
and so perhaps you could just re-issue that editing command using
whatever command line history is available. At least you wouldn't have
to re-type it.
Regards,
Chip Campbell
I do it this way:
First, add a alias in ~/.bashrc
aliase fht='source ~/fht/.bashrc'
Second, make your own dir
cd
mkdir fht
Third, create your own .bashrc in that dir, here is some snippet
# export 'HOME' for convenience
export MY_HOME=~/fht
# settings for vim
export MYVIMRC='$MY_HOME/.vimrc
export VIMINIT='source $MYVIMRC'
Fourh, create a .vimrc in your dir
When login, execute the aliase, and you can your own config for vim. Just as if the account is used only by yourself.
Fan Hongtao