Editplus replacement in ubuntu : jEdit

By tutysara

I work most of the time on UNIX machines through terminals. We use putty as our terminal client and when we want to edit any files we just copy the file name from putty into Editplus and open it.

When I moved to ubuntu I couldn’t find a replacement for Editplus which allows me to easily edit my files. There are many editors that I found in ubuntu which has FTP and SFTP support but they all open a file tree and they require us to navigate through the file tree to open the files. We used to navigate through various directory structure using putty and edit files from different locations, It is a lot of pain to navigate through different directories in those editors. This is very bad when the FTP connection becomes slow at peak hours.

I was actually looking at the comparison of various text editors and my quest for a Editplus replacement came to an end when I found jedit. It is a wonderful text editor with a host of options and features. It is open source and It is extensible by using various plugins. The plugin which provides support for FTP and SFTP is the FTP plugin. It can be installed by using the “Plugin Manger -> Install” tab. Once the installation is complete it can be found under “Plugins -> FTP”. Select the options “Open from FTP server…” or “Open from secure FTP server” fill in the server details along with user name and password and hit the connect button. Once the connection is established the FTP directory becomes a part of the jEdit VFS and all actions that are valid for a normal file can be performed on the FTP files.

To quickly open files for which the path is known we can use the open file macro found under “Macros -> Files -> Open Path”. We have to prefix the FTP file names with “ftp://user@server:21/path/to/file“.
Example – to open a file .profile use “ftp://user@server:21/~/.profile”

We can even write our own macro to ease this process. Macros are stored under the macros directory under installation directory or settings directory. We can write a simple macro to open a file automatically from a FTP server just by giving the path. This macro releaves us by typing “ftp://user@server:21/” whenever we need to open files from the server. Open a new file in jEdit and type in the following lines

void openPath()
{
String path = Macros.input(view,"Path name:");
if(null==path||path.length()==0){
return;
}
String prefix="ftp://user@server:21";
path=prefix+path;
if(path != null)
jEdit.openFile(view,path);
}

openPath();

and save it under the macros directory as Quick_FTP.bsh.
Now reload the macros list by selecting “Macros -> Rescan Macros” and our “Quick FTP” macro can be found. Select our macro and it asks for the path name . just give the path name to open it from FTP server. This is just a small how to on writing a Macro and demonstrating the robust features of jEdit. You can find lot of Plugins and Macros at the Community and Plugin site.

Tags: , ,

Leave a Reply