Come faccio ad aggiungere più account (macchina, login, password) in un file mia VIM .netrc?

StackOverflow https://stackoverflow.com/questions/4575312

  •  14-10-2019
  •  | 
  •  

Domanda

Ho appena la connessione a uno server tramite .netrc e ha funzionato bene, ma ora ho bisogno di essere in grado di connettersi al server originale e un nuovo account. Quando aggiungo nuove informazioni di account (machine, login, password) esso diventa subito segni sul conto originale che viene prima nel file .netrc.

Così adesso i miei VIM .netrc aspetto di file come questo:

machine oldsite.com
login old_username
password oldpassword

machine newsite.com
login new_username
password new_password

Come posso fare VIM / .netrc chiedermi quale account voglio accedere a?

È stato utile?

Soluzione

I realized that my problem was not in the .netrc file but in my .vimrc file. What I had to do was create a new mapping to ftp to newsite.com. So this is what I have in my .vimrc to get it working

map <silent> ;n :e ftp.newsite.com/public_html/<CR>
map <silent> ;o :e ftp.oldsite.com/public_html/<CR> 

The reason for my trouble was that I forgot all about the shortcut ';o' being assigned just to oldsite.com. To be more clear, I had basically forgotten exactly how it all worked. Only by back tracking through all relevant files did I figure it out.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top