I agree with @Conner that this is an ssh tunnel question, but anyway this is a possible answer.
You will need to replace "A", "B", "UsernameOnA" and "UsernameOnB" with the appropriate hostnames or IP addresses for A and B (and check if netcat is set to "nc" or "netcat" I saw both ..)
After that you can:
$ vim scp://RemoteHost/path/to/file
This setting works best if you have access to public keys for both systems, otherwise you will be asked to enter passwords.
source share