Edit your remote HTML files directly with WinSCP

WinSCPI have a handful of small, mostly-static, mostly for me, utility websites running on a Dreamhost shared server. There is no application framework or complex server environment to mess with, little user traffic besides what I send and no need for a heavy deploy process.

For these sites, I often want to edit HTML, JS and CSS files directly on the server instead of editing them locally and pushing them live. One step is better than two, I say.

Sure, I could SSH in and edit my files directly with vi, and I often do that. Call me crazy, but sometimes I like using a mouse and GUI to edit my files. For those times, I use a program called WinSCP. 

WinSCP is an “open source free SFTP client, SCP client, FTPS client and FTP client for Windows. Its main function is file transfer between a local and a remote computer. Beyond this, WinSCP offers scripting and basic file manager functionality.”

To use WinSCP:

  1. Download and install WinSCP
  2. Open the app, create a “New” connection to your server, and login
  3. In the right-hand panel, double-click the file to edit
  4. Make you changes and save
  5. Watch the WinSCP window and you’ll see your local cached copy replace your remote one

Out of the box, WinSCP will use its default, built-in editor for all file editing.

To use your own apps for editing:

  1. In WinSCP: select “Options” > “Preferences…” > “Editors”
  2. Click “Add …”
  3. Select “External editor:” (e.g. “Notepad++”)
  4. Set the extensions for this app to open (e.g. “*.html,*.txt”)
  5. Click “OK”

Now when you right-click a file in the right window and select “Open” it will open in the application that you selected. Note: for some reason double-clicking still opens it in the internal editor.

When you edit your file in your external editor and hit save, it will be automatically changed on the remote server. Very hand for a quick set of changes to a static HTML page.