Phpstorm Rsync



Download

I am using Laravel with PHPStorm and a custom server where I connect via SFTP. The problem is that being SFTP, it's not in sync. So everytime I generate files via php artisan command, I have to download the file(s) with PHPStorm. I know that I can get around that by using Homestead and Shared folders, but this project requires a custom VPS. Contribute to ibrows/BeSimpleDeploymentBundle development by creating an account on GitHub. Dismiss Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

Mar 08, 2021 By default, PhpStorm uploads the files if they are changed by some external processes (VCS, transpilers, and so on). If the files are not uploaded, make sure that the Upload changed files automatically to the default server on the Options page is set to Always and the Skip external changes checkbox is cleared. File sync with fswatch and rsync. Wednesday, 5th September 2018. Some projects I work on require that I use a remote web server. PHPStorm is my IDE of choice and, up until now, I've had it SFTP the files to the remote host.

i switched over to PHPStorm and don't use Atom.io anymore. Intellisense/Autocomplete etc. is 100x better than in atom.io.Feel free to use the plugin, but i will probably not update much.

atom-sync-cygwin is an Atom package to sync files bidirectionally between remote host and local over ssh+rsync.Inspired by Sublime SFTP.

This package is a clone of atom-sync and has a patch to use cygwin (or Windows Subsystem for Linux) emulation on Windows.If you install 'openssh rsync' on windows via cygwin (https://cygwin.org),then you can use the plugin also on Windows which then emulates the rsync inside cygwin.You need to put your C:/cygwin/bin/ in to %PATH% so that ssh and rsync are used on cmd.exe or atom.exe .

Please kindly try it outand provide feedback.

This Package still works fine under Mac, because there is no path C: , so the patch is ignored there.

To Prevent conflicts with the original atom-sync plugin this one is renamed to atom-sync-cygwin .

Feature

  • Sync over ssh+rsync — still secure,but much faster.
  • Multi-Folder Projects with different sync config files supported
  • Triggers conditionally run commands after successful uploading

Prerequisite

  • Ensure you have ssh and rsync installed.

  • Alternatively ensure you have ubuntu bash installed.

  • Special on Windows - Cygwin

    • Install Cygwin from https://cygwin.org
    • Select 'openssh' and 'rsync' from packages and install them
    • rsync is now available in the cygwin-terminal, but not visible from atom
    • add the cygwin/bin folder to %PATH% so that rsync is globally in cmd.exe
  • Add Path to cygwin/bin in windows 10

    • right-click on 'start-menu' choose 'System'
    • choose 'advanced settings'
    • change 'environment variables'
    • in the lower path select 'PATH'
    • click 'New'
    • Add Path to your Cygwin-Installation e.g. 'C:cygwinbin'
    • close dialogs
  • Special on Windows - WSL

    • Install Windows Subsystem for Linux https://msdn.microsoft.com/en-us/commandline/wsl/install-win10
  • now atom should be able to use ssh + rsync

    • to properly use ssh without password with autorized_keys, you need to have .ssh folder etc.
    • in cygwin you can open 'cygwin terminal' and check by 'ls .ssh'
    • in WSL you can open 'bash' and check by 'ls .ssh'
    • maybe you need to create a pub-key with 'ssh-keygen', look in internet for further instructions.
    • best to create a pub-key without password, so that you don't have to type password always.

Quick Start

  • Open a project folder to sync in Atom.
  • Right click on the project folder and select Sync -> Edit Remote Config.
  • Edit and save the config file.
  • Right click on the project folder and select Sync -> Sync Remote -> Local.
  • Watch water flows.

Notice

  • You have to assign your key file and better host name in .ssh/config in advanced. Try to Simplify Your Life With an SSH Config File.
  • For password based login you must install sshpass and set the shell property to /usr/bin/sshpass -p password ssh -o StrictHostKeyChecking=no -l username in the configuration file.

Config File (and Tutorial)

.sync-config.cson

Introduction to Trigger

Config

Result

Suggestion

Trigger is implemented via ssh, it would be great to use triggers with SSH ControlMaster by transferring data through single ssh tunnel instead of making one ssh connection for rsync and another for ssh command, which could be very slow under unideal network speed or connection limits.

Config sample of ~/.ssh/config

Keybindings

  • ctrl+alt+l (Windows/Linux) cmd+alt+l (Mac) Toggle log window

Known Problems

Phpstorm Rsync Plugin

  • You have to Sync Local -> Remote manually after renaming and deleting files.
  • Triggers not yet functional on WSL. If you have git bash installed ensure your .ssh folder matches between C:Usersusername.ssh and your WSL home folder and triggers should still function.

Roadmap

  • Listen to events
    • Create folders
    • Rename files/folders
    • What about deleting?

Often, during the development of applications or while creating templates for a development team to use, I have the need to comment out blocks of code. I find myself toggling that block of code from commented to uncommented as I test applications. Plus, sometimes within my Gulp.js scripts, I want to be able to easily toggle certain stream filters within my task. Even with IDE support for toggling comments, I find it a little tedious to be adding and deleting the /* and */ lines continually within my code.

Well, here’s a neat little trick to create a block comment that you can toggle by simply adding or removing a single slash (/) character. This uses a little trickery of combining line and block comments that I have found to work in most C-style languages such as C (duh), C++, C#, Java, PHP and Javascript. By surrounding your code block with //* and //*///, you can toggle the comment simply by removing (or adding) the first slash. Here’s a little example to demonstrate:

If you simply remove the first slash, the code block will be commented out:

In most cases, you don’t really need the last two // on the closing tag. However, I’ve found that if you have any text on the line after the closing comment tag that you want to keep commented out (e.g. “This text will always be commented out” from the above example), any text that follows the closing tag will not stay commented out without those last two slashes. (Note: the syntax highlighting above does NOT reflect this.)

Phpstorm Rsync License

Bonus Tip: Adding LiveTemplate to PHPStorm/WebStorm

I use PHPStorm from Jetbrains as my IDE of choice. One of the great things about these IntelliJ-based editors is their “Live Templates” which are like super-snippets with variables, placeholders and tab stops. By using the $SELECTION$ variable, you can execute the “Surround with Live Template” command or its equivalent keyboard shortcut (++J in my case) to wrap a block of text in the comment trick from above.

To create this Live Template, just open your PHPStorm/WebStorm preferences and go to Live Templates under the IDE Settings section. Create a new template with the following code snippet:

Phpstorm Deploy Rsync

I use //* as my Live Template abbreviation and define as its context the C-style languages: JavaScript, TypeScript, PHP, etc. Notice that the $END$ variable is where your cursor will end up after the code block is wrapped in the template. All you have to do is backspace to comment out the block. Here is my settings window:

Now, you can select a block of code in the IDE and use your keyboard shortcut (e.g. ++J) and you will see a context dialog box prompting you to wrap the code in your live template:

After hitting the Enter/Return key, you code should now be surrounded with your new Super Toggleable Block Comment with the cursor in place to hit backspace, which will comment out the block:

Phpstorm rsync activation

Thanks to Guy Wyatt for introducing me to this little trick.