Text Editors: Difference between revisions
Line 49: | Line 49: | ||
Dynamic language expertise for Perl, PHP, Python, Ruby, and Tcl, plus JavaScript, CSS, HTML, and XML, and template languages like RHTML, Template-Toolkit, HTML-Smarty and Django. | Dynamic language expertise for Perl, PHP, Python, Ruby, and Tcl, plus JavaScript, CSS, HTML, and XML, and template languages like RHTML, Template-Toolkit, HTML-Smarty and Django. | ||
[http://www.activestate.com/komodo_edit/ Komodo Edit] runs on every platform and supports both Vim and Emacs keybindings. It's really a first class editor by any definition of the word. | [http://www.activestate.com/komodo_edit/ Komodo Edit] runs on every platform and supports both Vim and Emacs keybindings. <!--It's really a first class editor by any definition of the word.--> | ||
===TextMate=== | ===TextMate=== |
Latest revision as of 14:34, 8 July 2017
Text editors are tools that let you edit text files. Some have nice bells and whistles for highlighting code syntax, autocompletion, find/replace, etc. Just about any editor is sufficient so long as you are comfortable with it. Some are less prone to user typing errors when used for tasks such as programming or scripting. Below is a non-exhaustive list of some text editors used around the lab, from command line tools to GUIs. Find one that you like and learn it.
NOTE: Ones that are available on Hoffman2 have H2 next to their names.
NOTE: Ones that tend to come preinstalled on Macs have OSX next to their names.
Command Line
Vim (H2) (OSX)
Vim is an old standby, it's the default editor on many, many unix based systems. It is a full featured editor with many plugins to extend functionality (if you need them). It's usable in the Terminal and has several GUI editors based on it as well. For the Mac, one such GUI is MacVim.
Vim is a modal editor. This method of editing puts off some users. If you're interested, you can access the built in tutorial called (ingeniously) vimtutor.
$ vimtutor
There are even some handy color cheat sheets: http://michael.peopleofhonoronly.com/vim/
Emacs (H2) (OSX)
Emacs is the other big player in editors. It's a first class editor with very powerful features, but easy enough to use for simple tasks as well. It also is usable in both the terminal and has several GUI options like AquaEmacs
You can access the emacs tutorial by
$ emacs
Once inside emacs, use the following key combo:
Control-h, t
GUI
Emacs (H2) (OSX)
As stated above, it has both command line and GUI versions.
On Hoffman2, if you log in with X11 Forwarding turned on, you will get the GUI version. Otherwise you will see the command line version.
TextEdit (OSX)
TextEdit is the built in OSX editor. By default, the files it creates are Rich Text. These are entirely unworkable for scripting or programming use. It also has a bad habit of leaving off appropriate UNIX end of line characters (this means a file looks like one big line to the operating system).
Though a decent general purpose editor, it's highly discouraged to use this editor for scripting, programming, or editing of system files (like your bash_profile).
Komodo Edit
From the site: Dynamic language expertise for Perl, PHP, Python, Ruby, and Tcl, plus JavaScript, CSS, HTML, and XML, and template languages like RHTML, Template-Toolkit, HTML-Smarty and Django.
Komodo Edit runs on every platform and supports both Vim and Emacs keybindings.
TextMate
TextMate is a very popular OSX editor. It has all the features you'd expect such as syntax highlighting, auto-indenting, etc. It's only draw back is that it does not have a terminal interface and does not work on other platforms besides OSX. It also costs money, which might turn away a starving student or two. For more information see TextMate.
Others
These are just a few and by no means meant to be exhaustive. However, there are some "essential features" you should look for when choosing your editor of choice. A few are:
- Syntax Coloring for source code and scripts
- Auto-indentation
- Plugable (e.g. others can extend it via plugins)
Though worthy of simple usage, the common basic editors Nano, Pico, and friends often do not provide the tools or functionality for writing error free, easy to read code or scripts. For anything beyond the ridiculously trivial the user should seriously consider a more feature rich editor.