I 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:
- Download and install WinSCP
- Open the app, create a “New” connection to your server, and login
- In the right-hand panel, double-click the file to edit
- Make you changes and save
- 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:
- In WinSCP: select “Options” > “Preferences…” > “Editors”
- Click “Add …”
- Select “External editor:” (e.g. “Notepad++”)
- Set the extensions for this app to open (e.g. “*.html,*.txt”)
- 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.