|
Emacs is a very studly text editor. It is not for the faint of heart - however it is well worth the effort required to learn it if you are a programmer or otherwise work directly with text files a lot. Emacs has all sorts of useful modes and plug-in type functions that make it well suited to editing just about any text file you could want. For example it knows about Perl syntax and will format Perl for you, plus it knows about the Perl debugger and will transform into a Perl IDE when you are writing and debugging a Perl script. Ditto for C, C++, JavaScript, Java, and most other languages. A lot of work I would have had to write a Perl script to do, I have done as a keyboard macro in Emacs. It is not super smart but it is pretty smart, so brute force search and replaces with complex searches are trivial to do 10,000 times in a single text file, or across a bunch of text files. Replacing a bit of slightly varying text in 400 HTML documents is possible with the query-replace regexp function. It answers the question, "what am I going to do to avoid having to do all this darn text editing by hand, file by file?" It is the text editor for heavy-lifting. And of course there is always Perl if it the problem is really complex, and you can write the Perl script in Emacs! If you have a Unix system chances are you already have Emacs. There is also a version available for Windows NT, and there is a port of Emacs for MacOS although every time I've checked out the latest MacOS port it has Sucked. I haven't tried it on MacOS X yet. My home page (this site) was coded using Emacs. As is all the work I have done for Westlake, iXL, and most of what I've Viant (i've used a few IDEs and random Windows text editors at Viant also).
My Emacs Bunny Slope guide. There is not a 1:1 correspondence between open files ("buffers") and windows. You can have 1000 buffers with one window, or 1000 windows open for the same buffer. You can also split the window into two panes, and those are similarly independent (same buffer shown in both, or not). NT Emacs is pretty annoying when first installed and takes some effort to configure correctly (so you can double-click files and have them open in emacs, for example). It's much better on unix, so if you're gonna learn it, IMHO you should start on unix to give it a fair chance. Emacs understands a lot of different syntaxes: C, Java, Perl, Lisp, Make, HTML, JSP, PHP, etc. Some of these aren't included with the standard installation so you have to go find them and figure out how to install them. It's worth it, though, because these add-ons usually include syntax coloring, auto indentation (which behaves oddly if the syntax is wrong - a tip off that you have made a mistake), and a cool parenthesis (and bracket, and brace) matching thing which helps you keep your () {} [] pairs balanced properly. Stupid syntax errors are obvious long before you try and compile something, which makes coding go much faster. ange-ftp rules. It lets you open files on a remote FTP server into a local buffer, PUTting them back via FTP every time you save. It works with zero effort on unix but it's hard to get it working on NT. Clever use of search, query-replace, and keyboard macros can help you accomplish complex text manipulation that you might otherwise have written a simple Perl script to accomplish. It's not as fast as Perl, but if you need to so fairly simple and repetitive one-off text whacking, it's easier to just make a keyboard macro and run it 10000 times than it is to write a throwaway Perl script just for this one occasion. And you can save keyboard macros if you have a particularly clever one. Emacs has been around for a while and has a lot of nutty programmers who love it, so there are a huge number of .emacs files (try http://www.dotfiles.com/) and .el emacs-lisp files which add weird functionality to emacs. |