I'm trying to use Vim as a substitute for DreamWeavers nice FTP-client sidebar. But I would like for Vim to 'remember' my logins, - so I don't need to get the FTP-address, the username and the password, every time I need to connect to a remote server, to make some changes. I've made it as far as to figure out, that one can setup a .netrc-file, where you can save login-credentials (and possibly encrypt it using GPG, which I will look into, after I've goten this to work). I can find endless manuals and tutorials about how to setup the .netrc-file, - but no information on how to actually use this .netrc-file.
So if my .netrc-file looks like this:
machine <hostname1>
login <login1>
password <password1>
machine <hostname2>
login <login2>
password <password2>
Then how to I for instance connect to <hostname2>
? Do I write vim <hostname2>
- and if so, then what if I have several different remote servers on the same host (where the user and password-credentials vary)?
Ideally, I would like to just be able to write something along the lines of
vim ftp://MY_OWN_NICKNAME_FOR_A_REMOTE_SERVER
Whereafter Vim will find the credentials in the .netrc-file and connect me to the given server. How do I do this?