Since moving to Linux, I've been looking for an alternative. I wanted it to be light-weight, easy code completion and remote file editing. I found many choices in the Linux world and majority of them open source. I tried gedit, kate, Quanta, Eclipse, gPHPEdit, BlueFish and Geany. All of these have their advantages and disadvantages and someone is bound to like one over the other. I won't go into reviewing all of them and would suggest to try them out yourself. I preferred gedit and geany over the others.
gedit
gedit is fast and it does pretty much everything you want from an editor. It lets you edit remote files without any hassle. It is also a default text editor on many Linux distributions. I found a lot of problems with Code Completion. gedit auto complete files in XML format e.g. in /usr/share/gedit-2/plugins/snippets/html.xml is the snippets file for HTML. It was not an easy job converting my current snippets into an XML type. The following code is an example of what you would need in there to auto complete "br" tag.
<snippet id="br">
<text><![CDATA[<br />
$0]]></text>
<accelerator><![CDATA[<Shift><Control>space]]></accelerator>
<description>Br</description>
</snippet>
After spending over an hour setting up the XML snippet for HTML, CSS and PHP, I found that if you try to autocomplete PHP code when you have a HTML file open it would not work. So I merged the 3 xml files into /usr/share/gedit-2/plugins/snippets/global.xml. Adding autocomplete code in this file will work for any file type including unsaved and empty files.
So I migrated my autocomplete file from Editplus format to gedit xml file. After all the tedious work, I found that the auto complete would not always work and it was unreliable. I had to restart gedit many times to get it working.
Geany
This is one the the best editors out there, The more i used it the more i liked it. It is a very light-weight with many plugins and features.
It auto completes XML/HTML tags by default. In preferences > editor > completion, you can auto-close quotes and brackets:
Brackets ()
Curly brackets {}
Square brackets []
Single quotes ''
Double quotes ""
To add custom snippets, go to tools > configuration files > snippets.conf and it will open in another tab. This is the only file you need to modify for all your needs, the snippets are added into different sections. Anything under [default] will work on any file type and adding code in [PHP] section will work for php files only.
Here is an example adding br tag to autocomplete for HTML files:
[Default] [PHP] [HTML] br=<br />
How easy was that? The word before the "=" sign is what you will type and on pressing "tab", everything after the "=" sign is what will be replaced with. Save and test it out in a new document. This is alot similar to Editplus and easier than gedit xml.
At present, there is no direct FTP support in Geany and there is no plug-in available. For linux users there is a way, if you go to tools > plugins manager > Tick File Browser and click on View > Tick "Show Sidebar. On the sidebar, click on "Files" and navigate to "yourhomedirectory. Right click and Tick "Show Hidden Files" and navigate to ".gvfs" directory which will show your ftp folder. You can now modify remote files locally.
I found this is a perfect alternative to Editplus and even better. It works on many platforms and its FREE. For Linux its easy download from Software Packages such as Ubuntu Software Centre and for windows Download Here.
Download Geany snippets and extras.
3 comments:
Nice post! one question Regarding Geany FTP configuration i couldn't find ~/.gvfs do i have to create that directory? please five more information.
Thanks,
hi achu,
.gvfs folder is found in your home directory. If you browse to your home directory and then press Ctrl+H
Or in geany, enable file browser in plugins and then on the left hand side browse to your home directory, right click and tick "Show Hidden Files".
Similar story here; I found Geany when I moved to Linux and had to leave Notepad++ behind. Turns out that Geany is a cousin of Notepad++; they use the same Scintilla core.
My best suggestion for Geany is to read the manual and explore the configuration - especially the keybindings! There are lots of helpful commands that don't appear in the menus, which you can assign to hotkeys. One by one, I've uncovered each of the features that I missed from NP++, which I originally thought Geany didn't have, like Volatile Search, plus I've found a stack more, like 'Select to next word part'. I think that even if I went back to Windows, I might stay with Geany...assuming that it runs better with GTK on Windows than NP++ does in Wine (mostly OK, but unstable).
Post a Comment