Alec the Geek

mobile version http://alecthegeek.mofuse.mobi/

Handy Hack: How to use Vim netrw in ftp passive mode

Posted by Alec on 6 February 2007

The Vim editor can edit files on a remote machine using ftp to open and save the file (other protocols such as DAV and scp are also supported). The plugin is called netrw and comes standard with modern Vim.

When using ftp it is often the case that passive mode must be used across firewalls, which is not ftp’s default behaviour (at least not on my Linux system). However ftp often has a command line switch to force passive (e.g. -p). Just add let g:netrw_ftp_cmd="ftp -p" to your ~/.vimrc file. You will need to change this depending on the specific options and features of your ftp program.

2 Responses to “Handy Hack: How to use Vim netrw in ftp passive mode”

  1. Celi said

    Thanks for the tip! Very handy.

  2. Thanks a lot — first result on a search for “vim pasv ftp” and did exactly what it said on the tin!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>