Text editors are extremely important for programming. It is not really important that you use a specific one, but it is a good idea to get very familiar with the one that you like.

Text manipulation and considerations

Plain text manipulation is extremely important for analysis and programming. The difference between a plain text file and a text file that you might edit in a word processor (Microsoft Word or LibreOffice) is that a plain text file will only have the text you see and no formatting besides spaces, tabs, and the ending of lines. Spaces, tabs, and ending of lines, although they are often invisible in the text file, you can turn on in many editors the ability to see them and they are encoded as \s for spaces \t for tabs and \r or \n for line endings. One other major consideration for these is the line endings. Linux/Unix uses \n, old macs use \r and windows uses both together. We are going to always want them to be \n and most text editors have trivially easy ways to detect what is used and convert it to what we like. We edit plain text files in plain text file editors (see below). There are a seemingly endless number of options for plain text editors. Here are a few and links to tutorials for some.

Editors: the classics

These are cross platform and are the go to editors for most programmers. Even if you decide to use something else for programming, it is always good to get familiar with at least one of these. They have a bit of a learning curve so I have provided tutorials for these. If you want to know what I use. Well, I use both emacs and vim (probably on a daily basis) and I use geany when I need something with a mouse.

  • emacs: originally written by Richard Stallman, emacs is a feature full text editor (you can play games, check email, program, almost everything). In fact it is so feature full that it has been called a good operating system but a decent editor. It is distinguished from vim, at least for us, in that it has heavy use of ctrl and meta keys to do commands (so you hit Ctrl-X Ctrl-S to save a file).
  • vim: sometimes you will see vim as “vi” (everyone uses vim which is “vi iMproved” but people abbreviate to vi). This is the more lightweight alternative to emacs. That said you can extend it to be as complex as emacs if you like. The major usage difference is that instead of ctrl and meta keys, vim uses modes. So you switch between text edit and command modes.
Editors: system specific
  • geany: a general purpose text editor with a nice graphical interface, good grep functions, and plugins. If you are using ubuntu or other debian based machines you can probably install geany with just sudo apt-get install geany
  • textwrangler: a widely used general purpose text editor with a nice graphical interface, good grep functions, and plugins. Similar to geany on Linux.
  • notepad++: probably the best windows text editor available

Leave a Reply