Sunday, March 24, 2013

Text Editors

I write code on occasion.  I've found that most people who write code have a favorite text editor for doing that.  I haven't found anybody for whom that text editor is Notepad, but I'm getting ahead of myself.  This happens to be a subject where I have some opinions.  However, I have to be honest and say that I haven't really investigated the  multitude of text editors out there.  Another thing to note is that I spent my formative computer years using Windows products, so I like having certain keyboard shortcuts, most notably CNTL-C for copy, CNTL-X for cut, CNTL-V for paste, CNTL-S for save, CNTL-Z for undo, and CNTL-Y for redo.  I know there are plenty of text editor editorials and guides out there, but this is mine.

Geany
Right now my text editor of choice is Geany.  Geany seems to fit my style pretty well.  It has automatic text highlighting for the languages I use most, it has tabs, and it also is available easily on Windows as well as Linux.  I know that it is in the repositories for Ubuntu and an RPM can be found for Red Hat/Fedora/CentOS.  I have also been able to easily build it from source on CentOS when I did not have root access, though it does have a few library dependencies (GTK++ is one of them I think).  I haven't decided if Geany is a heavyweight text editor or a lightweight IDE.  However, it loads up pretty fast, and if I have other files open, can autocomplete variables, class names, and functions out of those open files.  If I'm writing in XML, it will also automatically created close tags, which is can be pretty nice.

Notepad
I hate Notepad.  Notepad wasn't quite the first text editor I ever used (I think that was edit, back on DOS) but it was close.  There are many reasons I dislike Notepad.  Here are the main ones:

  • No tabs: If I am working with text files, there is a reasonable chance I am working with many text files simultaneously.  Having each file in a separate Window is infuriating
  • No text highlighting: text highlighting is very helpful when working with code, 'nuff said
  • No line numbers: again, something very helpful when working with code
  • And the kicker: no support for new lines without a carriage return
Seriously, I can't read any text file generated on a *nix system because Notepad doesn't realize that \n means newline, it requires \r\n.  I can't imagine this is that hard to fix, and sure anybody who is actually going to write code at all is going to get a better alternative (the previously mentioned Geany, Notepad++ is pretty good too).  However, to not include something at least marginally better than Notepad seems like a big FU to developers.

Notepad++
Notepad++ is an excellent choice for replacing Notepad on Windows.  It fixes all 4 gripes I posted (but not all that I have, believe me) about Notepad.  The main reason that it is not my primary text editor on Windows is that I can't get it for Linux.  I work in Linux often enough, that having my text editor similar in both Windows and Linux is enough of a boon to push Geany above Notepad++.  Because of this, I haven't actually used Notepad++ in probably over a year.  However, it is still a quality text editor.

vi / vim
If I only have access to a command line editor, or if all I want to do is make a very small modification to a text file, I use vim (or plain vi is vim is not available).  vi is incredibly powerful if you know how to use it.  I know how to use very small parts of it, enough to move around somewhat quickly, do search/replace, a little bit of cut and paste, and mass deletions.  However, these don't follow my normal keyboard shortcuts, so sometimes I mess up pretty badly (which is why repositories are my friend).

If I have to do lots of coding on a system with no GUI (and therefore no Geany) what I'll actually do is develop on a system with Geany, and then just rsync files up to the GUI-lacking system.

Emacs
I don't hate emacs, but I don't typically use it.  If a system has emacs, it probably has vi as well, and I have already become proficient enough with vi.  Also, the control characters really throw me off.  I know that I could create my own initialization file which sets those to my preferences, but then I would have to port that file around everywhere.  I haven't even gotten to the point of porting a .bashrc around everywhere (Note to self: I should probably push a .bashrc onto my Google Drive at some point).

UltraEdit
UltraEdit was the first text editor I ever used that I actively liked.  I actually paid for the license back in high school when I was using it (and the license cost $30) for version 9.  I haven't used it in years due to the cost associated with it, and by then I had found other text editors that I liked, but I do remember the column edit mode was pretty sweet, where I could grab a rectangle of text in the middle of other text.  Maybe I'll grab the free trial and play around with it some more, see if it is worth the money and capable of ousting Geany from my top spot.  Another bonus (at least on the version that I had used to have): built in Hex editor.

I think that is all for now.  I may talk about IDEs I have used (Eclipse, JavaBeans, Visual Studio Express, MonoDevelop, more Geany) at some later point.  Or this blog could go the way of many other journals I have started, and I just forget about it (I'm looking at you livejournal).

No comments:

Post a Comment