Edit Files "Live" Via FTP With Notepad++ [How-To]

Posted Jun 8, 2009 | by Rich Menga  

If you run your own web site and run Perl, PHP scripts or the like, there will be instances where you have to edit some files from time to time.

The long way to do it is to download the file you need to edit, modify it, then upload it back.

The short way is to edit the file "live" on the server directly. Using Notepad++ this is easy to do with it’s built-in FTP feature.

First, enable FTP folders by clicking the small yellow folder icon at top:

image

You will see a right and bottom pane appear, similar to this:

image

In the FTP Folder window at right, click the settings icon (the gray one that looks like a gear).

You’ll get a window like this:

image

Click New (bottom left button) to start a new profile.

Enter Profile as the friendly name you want to remember this FTP server by, such as "My FTP Server".

Enter Address as the FTP server you want to connect to, followed by your username and password.

If using Windows XP, you don’t have to set anything else up.

If using Vista or 7, you do have to set the Use profile cache directory to a local writable folder (such as My Documents for your local Windows account). If you don’t do this, you will not be able to edit any files "live".

When done, click OK.

To the left of the settings icon you clicked is a blue plug-looking icon:

image

Clicking this will bring up your server list. It will show the entry you just created. Click your entry and you will establish an FTP session with your server.

From there you can double-click any file you want (as long as it’s text based) to edit, seen below.

image

After double-clicking a file it will open in the editor as a tab (each successive file you open will create more tabs). Make your edits, then save the file with the save button or CTRL+S, and it will be saved direct-to-server.

Which Of These Traits Applies To YOUR Computing Life?...

11 Responses to “Edit Files "Live" Via FTP With Notepad++ [How-To]”

  1. Jack says:

    Nice, but you can’t create files with Notepad++ in FTP folders? With PSDpad you can create an empty file.

  2. Jack says:

    Aah sry, you can, just create new file and “Save as”

  3. Tommy says:

    I don’t get it. How you use “new file -> save as” to create a new file on the ftp? The save dialog is just a standard windows dialog with no place to select the ftp?

    • Rich Menga says:

      The “new” part is to set up your FTP access in Notepad++. After logging in, you double-click any editable ASCII file (php, html, etc.) on the remote file list, Notepad++ will local-cache it temporarily while you make your edits. When you save, it will save the changes in the cache, then upload the updated file direct to the server.

  4. weehawker says:

    I think Notepad++ is great. If there was a Linux version, I’d probably use that on my home system. But a couple of times lately, Notepad++ has crashed and the open file got lost: saved with zero bytes! I know windows sucks and all, but is there a way to prevent this from happening?

    • Rich Menga says:

      On the Linux side, gedit pretty much does everything Notepad++ does (it has a plugin system so it can be extended out quite a bit.)

      The “trick,” if you will when running Notepad++ on Win Vista or 7 is for editing files via FTP “live,” on creation of an FTP profile, check the box for “Use Profile Cache” and specify a folder somewhere in My Documents (I suggest creating a folder for each FTP site you use.) On XP this isn’t necessary, but on Vista/7 it’s more or less required because of writing permissions stuff.

      If it’s local files you having issues with, click Settings / Preferences, hit the “New Document/Open Save Directory” tab, see the bottom and specify the My Documents folder as your edit dir. This should take care of any crash issues. Also, if you’re editing a lot of UNIX-specific text files, tick the option for “Unix” under format in that same tab.

  5. Thanks, it really helped a lot! Simple and cool post!

  6. dave says:

    It doesn’t look like FTP is normally included, at least with the latest version of Notepad++, at least under Windows. I just freshly installed Notepad++ v5.5.1 and there isn’t a “small yellow folder icon at top” as pictured.

    I eventually found that what’s missing is the FTP_Synchronize plug-in. I found a link to download it from this page:

    http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Central

    The download had a FTP_Synchronize.dll file that needs to be copied to C:\Program Files\Notepad++\plugins.

  7. jlemm says:

    Be warned, if Notepad++ crashes during an edit of a remote file, you will lose the content of that file (happened to me a couple of times and I lost valuable code this way).
    So keep a copy or don’t use Notepad++ for remote file editing until it becomes more stable.

  8. Thanks. Nice post. Always wanted something like that; have been using Notepad++ for quite sometime now but never noticed this … lol …

Leave a Reply