Search code examples
vimftpnetrwpassive-mode

Vim: Edit files on FTP server over Passive (PASV) mode


I need to access a server using an FTP client in passive mode, but how do I do this for Vim FTP connections?

Running ftp -p 12.34.56.67 works fine, but how do I do this when starting vim (for ex. vim ftp://12.34.56.78/)?


Solution

  • This article states that you need to add this line to your .vimrc:

    let g:netrw_ftp_cmd="ftp -p"
    

    After that, according to this article, you should be able to do:

    vim ftp://[email protected]//the/path/to/yourfile.php
    

    This seems to be a native Vim function.

    Note: This option should be turned off for FTP servers that are not passive.