1
votes

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?

1
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
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
Maybe the following thread will help you: stackoverflow.com/questions/2950107/…ernix
@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
@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

1 Answers

2
votes

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.