1

I am learning VIM. I have a local project, and I want to keep it synchronized on FTP server. So I need:

  • turning automated sync on, when i edit files localy
  • turning it off
  • forcing to uploading one file (useful when automatic sync off)
  • forcing to download one file
  • way to compare local and FTP version of a file

I use those features all the time with PHPStorm IDE, and now I wonder is it possible at all in VIM. I was thinking... maybe to use external rsync app or svn, and sync svn with ftp. Is that more like the way to go?

Luigi
  • 866
  • 13
  • 34
  • That's tipically the kind of thing you never have to think about anymore when using a VCS like Subversion or Git. What OS do you use? Can you install stuff on your server? – romainl Sep 25 '11 at 11:32
  • Windows XP, I use shared hosting with no support for VCS. I can't change the hosting for now. Im not in charge in this kind of things. – Luigi Sep 25 '11 at 11:38
  • Maybe the following thread will help you: http://stackoverflow.com/questions/2950107/git-push-into-production-ftp – ernix Sep 25 '11 at 12:22
  • @Luigi Just curios, I am solving the same problem in 2021 with my PhpStorm->Vim switch. How have you evolved please? Are you still using vim and have you found your own solution for FTPing? Or did you quit VIM and enjoy some IDE? – František Heča Aug 02 '21 at 07:07
  • 1
    @FrantišekHeča I use PhpStorm in my daily work now. I use vim only when I ssh to a server, or want to do a simple text edition outside of project (like a config file). I also don't use FTP anymore. All my work gets persisted in git repository, and deployment to any environment happens from there via pipelines etc. I guess I've matured since 2011 :) – Luigi Aug 24 '21 at 12:53

1 Answers1

2

You can install this plugin which allow you to open a remote file with

:e ftp:www.foobax.com/myfile.txt

and save it locally

:w myfile.txt

(use w! to overwrite it)

You could diff it using the diffsplit command. Example (on the window containing the remote file)

:diffsplit myfile.txt 

Obviously, if you can use a VCS, that's even better.

mb14
  • 22,276
  • 7
  • 60
  • 102