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 out
and 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 .
- 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
-
Ensure you have
ssh
andrsync
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:\cygwin\bin"
- 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.
- 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.
- 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.
.sync-config.cson
remote:
host: "HOSTNAME", # server name or ip or ssh host abbr in .ssh/config
user: "USERNAME", # ssh username
path: "REMOTE_DIR" # e.g. /home/someone/somewhere
behaviour:
uploadOnSave: true # Upload every time you save a file
syncDownOnOpen: true # Download every time you open a file
forgetConsole: false # Never show console panel even while syncing
autoHideConsole: true # Hide console automatically after 1.5s
alwaysSyncAll: false # Sync all files and folders under the project \
# instead of syncing single file or folder
option:
wsl: false # Enable Windows Subsystem for Linux mode
msys: false # Enable msys paths (wsl option takes priority)
deleteFiles: true # Delete files during syncing
autoHideDelay: 1500 # Time delay to hide console
#excludeFrom: '/absolute/path/to/exclude/file' # Use rsync exclude file
exclude: [ # Excluding patterns (leave empty array if only using excludeFrom)
'.sync-config.cson'
'.git'
'node_modules'
'tmp'
'vendor'
]
flags: 'avzpur' # Advanced option: rsync flags
#chmods: 'Du=rwx,Dgo=rx,Fu=rw,Fog=r' #force the permissions to be set to 755 for Directories and 644 for Files
shell: 'ssh'
# or
#shell: '/usr/bin/sshpass -p password ssh -o StrictHostKeyChecking=no -l username'
trigger: # Triggers fire after uploading file successfully
# which STARTS with following patterns
"*": "uptime" # Wildcard trigger for any file uploaded
"resources/scripts/coffee": [ # Any file under %PROJECT_ROOT%/resources/scripts/coffee \
# being uploaded will fire this trigger
"echo Compile coffeescript to js ..."
"coffee -b --output js/ --compile coffee/"
"ls public/js/|xargs -I@ echo \\t@" # You can also pipe commands but don't \
# forget to escape special characters
]
"resources/scripts/sass": [
"echo Compile sass to css ..."
"sass --update resources/scripts/sass:public/css"
]
trigger:
"*": [
"echo \'<span class=warning>Every time you\\'ll see me</span>\'"
]
"coffee": [
"echo Compile coffeescript to js ..."
"mkdir -p js"
"coffee -b --output js/ --compile coffee/"
"ls js/|xargs -I@ echo \\t@"
]
"sass/style.sass": [
"echo Compile sass to css ..."
"mkdir -p css"
"sass --update sass:css"
]
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.
Host *
ControlMaster auto
ControlPath ~/.ssh/ssh-%r@%h:%p
ControlPersist 10m
ServerAliveInterval 30
ctrl
+alt
+l
(Windows/Linux)cmd
+alt
+l
(Mac) Toggle log window
- 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:\Users\username\.ssh and your WSL home folder and triggers should still function.
- Listen to events
- Create folders
- Rename files/folders
- What about deleting?