The emacs EditorMost emacs lovers hate vi and vice versa. Why such rivalry? Well, I hope that you have yet to be tainted by someone else's opinions. I hope that you can make a decision on your own from this Unix lesson alone. Take a look at both and form your own opinion on what can be most useful to you and learn how to use that tool as in-depth as you can. In this lesson, we will look at the emacs editor. You will find that the biggest difference between the emacs editor and the vi editor is the actual footprint of the programs. Whereas the vi editor is a lightweight, highly functional tool, the emacs editor is a dense, unbelievably functional tool. Don't worry, both will serve just about any need you can dream of; most times the selection is preference. Very few get to levels where they know so much about both that they can rattle off verbatim all the differences and why you would want to use one over the other in specific circumstances. The easiest way to make a decision if you are completely new to Unix is to consider again that the vi editor is functional and very lightweight. The vi editor doesn't eat up a lot of your computer's hardware resources like memory and CPU cycles. The emacs editor, however, can be resource intensive and actually tax your system, making it perform slower if too many resources are used. This is because emacs contains a great many things such as an email client, a programming language, and many other features. In a more technical light, emacs is by far more functional than vi, but again, it all depends on what you are looking for. For the price of functionally, you pay the cost of resource consumption. Life is a give and take, so is Unix running on your workstation's hardware. When we covered the vi editor, we covered its mode. When using emacs, you are always in insert mode. Control (Ctrl key) functions are handled by using Ctrl key sequences instead of a separate mode. We will cover these momentarily. Now that you understand the differences when using emacs and how it operates, let's take a look at how to use the editor:
That's it; it's that easy to do. Once opened, the emacs editor is very similar to the vi editor in that you will manipulate the file's contents, save it, and so on.
Once emacs opens, you will see many ways to get help. Although you can explore on your own, it's suggested you know some basic navigation first; emacs is just as tricky as vi is to get around and takes a little practice first.
Learning and using the emacs editor can be difficult, but here are some tips to help you navigate it and learn it:
Beyond the set of Ctrl+ commands that you can use within the emacs editor, the Escape key can also add more functionality if needed. These commands are usually known as emacs meta commands for historical reasons. Although they're too complicated and too specific to cover in this book, access to many of the interesting emacs meta commands is accomplished by pressing Esc x, and then typing a command of some sort, such as info. The editor will then give you a list of all commands with similar names for you to choose from. You can see that you will find what you need from the list for most situations.
Now that you have learned how to edit the files at the shell prompt, let's dive into the GUI and learn how to edit files in KDE. |