Easy coding in test or dev with Atom

When I go to a customer and help with or introduce ansible I often see that they tend to use "vi" as their coding editor.  I know, some think it's the most awesome editor out there, but I do see happy faces when I introduce them with atom (ps : visual studio code works just a well).

The cool part with atom is that you can code locally on your laptop, and have the changes upload instantly to your linux machine.  This brings the best of 2 worlds together.  You can code in an editor that was build with color coding, plugins, folder struture management and git integration.  You have a local copy of your code, so you can code at home, in the train, ...  And then sync the code to your dev/test linux environment where you can test & run the code.

My approach

  • Download and install Atom from https://atom.io
  • Install the package "remote-sync" (I use the version from yonkangchen)
  • Start a local folder structure in the Project pane
  • Right click on your folder 
    • choose "remote sync" -> configure
    • And setup an scp connection to your linux host
    • Choose "upload on save"
    • (It will create a ".remote-sync.json" file) => check out the ignore section too
  • Create files and see how they get uploaded during save.

Now you can have 2 screens open, one with your linux ssh session and one with your editor.

This is how I code.  


On my laptop I also install the Git CLI and in my local code folder I can now initialize a connection with a Git repository.  Each time I change files now, I can stage them in Atom, commit them and push them.  Really easy and awesome.

Visual Studio Code

I know visual studio code can do this too.  It's all about personal preference.

  • Install the extension "ftp-sync" 
  • Configure it using ctrl-shft-P and search for ftp-sync
  • Choose "sync file local to remote"
  • Choose sftp as protocol.  

Post a Comment