Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12491
  • 博文数量: 14
  • 博客积分: 560
  • 博客等级: 中士
  • 技术积分: 150
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-17 16:40
文章分类
文章存档

2010年(14)

我的朋友
最近访客

分类: LINUX

2010-09-12 15:59:43

Chapter 1. Emacs Basics
第一章 Emacs基础

Some of you out there are probably dying to get your hands on the keyboard and start typing. We won't try to stop you; turn to the section called "Starting Emacs" and you can go ahead. But do read the beginning of this chapter later when you're ready for a break. Emacs is much easier to learn if you understand some of the basic concepts involved, which we discuss in the following introduction.  
    你们中的一些人已经迫不及待的把手放在键盘上并开始录入。我们不会去阻止你;翻到“启动Emacs”章节,你可以尝试一下。但是当你准备休息一下的时候一定 要读一下本章开始的部分。如果你理解了我们接下来介绍的一些Emacs基本概念,Emacs的学习将变得很容易。

1.1. Introducing Emacs!
1.1. Emacs介绍!

GNU Emacs is one of the most commonly used text editors in the world today. Many users prefer Emacs to vi (Unix's standard editor) or to other GUI text editors. Why is Emacs so popular? It isn't the newest tool, and it's certainly not the prettiest. But it may well be the most useful tool you'll ever learn. We want to present what you need to know about Emacs to do useful work, in a way that lets you use it effectively. This book is a guide for Emacs users; it tries to satisfy the needs of many readers, ranging from casual users to programmers.
    GNU Emacs 是当今世界上最常用的文件编辑器之一。许多用户喜欢Emacs而不是vi(Unix的标准编辑器)或者其他可视化文本编辑器。为什么Emacs如此受欢 迎?它不是最新的 工具,当然也不是最漂亮的。但它很可能是你学过的最有用的工具。我们想向你介绍你Emacs必要的知识来完成有用的工作,甚至让你高效的使用 它。这本书是一本Emacs用户指南,它试图满足各种用户的需求,囊括一般使用者到程序员。

Our approach therefore isn't to tell you absolutely everything that Emacs does. It has many features and commands that this book doesn't describe. We don't think that's a problem; Emacs has a comprehensive online help facility that helps you figure out what these are. We focus our attention on describing how to get useful work done. After covering basic editing in the first three chapters, we describe how to use Emacs as a comprehensive working environment: how to boost productivity with multiple buffers and windows, how to give commands without leaving the editor, how to take advantage of special editing modes, how to use Emacs for editing special types of files (source files for various programming languages), and so on. We cover the most important commands and the most important editing modes. However, you should always keep one principle in mind: Emacs does many things well, but it isn't important for that reason. Emacs is important because of the integration of different things you need to do.
    因此我们的方法不是告诉你Emacs的所有细节。有很多的功能和指令在本书中没有描述。我们不认为那是个问题,Emacs拥有广泛的在线帮助工具能帮助你理解他 们。我们把注意力放在如何完成有用的工作。完成前三节基本编辑的介绍后,我们介绍如何让Emacs成为一个综合工作环境。如何用多个缓冲区和窗体来提高生产率; 如何在不离开编辑器的情况下运行命令,如何利用特定的编辑模式,如何用Emacs编辑特定的类型的文件(各种类型的编程语言的源文件)等等。我们涵盖了最重要的 指令和最重要的编辑模式。然而,你始终要牢记一个概念:Emacs可以做好很多事,但它不是因此而重要,Emacs之所以重要是因为他整合了你要完成的不同的事。

What does integration mean? A simple example will help. Assume that someone sends you a mail message describing a special command for accessing a new printer. You can fire up an Emacs shell, paste the command into Emacs, and execute it directly.  If it works, you can edit your startup file to create an alias for the command. You can do all this without leaving the editor and without having to retype the command once. That's why Emacs is so powerful. It's more than just an editor; it's a complete environment that can change the way you work.
    整合是什么意思呢?一个简单的例子就可以解释。假设有人给你发了封邮件,描述了访问新打印机的特殊指令。你可以启动一个Emacs,把指令粘贴进Emacs,然 后直接执行它。如果它能运行,你可以编辑你的启动文件为这个指令创建一个别名。你可以做这些所有的事而不用离开编辑器并且不用重新键入那个新指令。这就是E macs为什么如此功能强劲。它不仅是一个编辑器,它是一个完整的环境以至于可以改变你的工作方式。

An initial word of advice, too. Many people think that Emacs is an extremely difficult editor to learn. We don't see why.  Admittedly, it has a lot of features, and you probably will never use all of them. But any editor, no matter how simple or complex, has the same basic functions. If you can learn one, you can learn any of them. We'll give you the standard mnemonic devices that will help you remember commands (like "C-p means previous line"), but we really don't think even these are necessary. They get you over an initial hump in the learning process but don't make much difference in the long run.  Learning to use an editor is basically a matter of learning finger habits: learning where to put your fingers to move to the previous line. If you experiment with Emacs and try typing a few of our examples, you'll quickly acquire these finger habits. And after you've acquired these habits, you'll never forget, any more than you'll forget how to ride a bicycle.  After using Emacs for a day or two, we never had to think, "C-p means previous line." Our fingers just knew where to go. Once you're at this point, you're home. You can become creative with Emacs and start thinking about how to put its features to work for you. Emacs has extensive menus, but we still recommend learning the key bindings for commonly used commands. Good finger habits can make you an incredibly fast typist, and reaching from keyboard to mouse only slows you down.
    提前给大家一个忠告,很多人认为Emacs是一个相当难学的编辑器。我们不明白为什么。不可否认,Emacs拥有很多功能,不过你永远不会用到全部这些功能。 但是不论一个简单还是复杂的编辑器都具备相同的基本功能。你既然能学会一个,那么你也能学会其他的。我们将告诉你标准助记符来帮助你记住命令(例如"C-p表 示光标向前一行"),但我们认为这些不是必要的。他们能帮助你在初始阶段克服一些困难但是从长期看并不会有什么区别。学习一个编辑器基本上就是培养手指习 惯:学习为了将光标移动到上一行手指应该如何移动。如果你已经用过Emacs并且试着录入了我们的一些例子,你会很快养成这些手指习惯。当你养成这些习惯,你 会永远记住他们的,并且比你忘记骑自行车的可能性还小。当使用一两天后,我们不假思索就能知道“C-p是光标移动上一行的意思。”我们的手指就知道应该移动到 哪儿。一旦你达到这种程度,你就算入门了。使用Emacs会让你变得更富创造性,并且你开始考虑让一些Emacs的功能为你所用。Emacs拥有丰富的菜单,但是我们还 是强烈建议你学习常用指令的快捷键。好的手指习惯会让你成为超级打字员,而且把手从键盘移动到鼠标会降低你的速度。

The finger-habits approach also implies a different way of reading this book. Intellectually, it's possible to absorb a lot from one reading, but you can form only a few new habits each day. (Unless, of course, they're bad habits.) Chapter 2 covers most of the basic editing techniques you'll use. You may need to read it several times, with a slightly different focus each time. For example, Emacs gives you many different ways to move forward: you can move forward one character, one word, one line, one sentence, one paragraph, one page, and so on. All of these techniques are covered in Chapter 2. Start by learning how to move forward and backward, then gradually add more complex commands. Similarly, Emacs provides many different techniques for searching through a file, covered in Chapter 3. Don't feel obliged to learn them all at once; pick something, practice it, and move on to the next topic. No one will complain if you have to work through the first three chapters of our book several times before you're comfortable. Time spent developing good habits is time well spent.
    手指习惯还暗示了阅读本书的另一种方式。理论上讲,在一次阅读后可以掌握很多手指习惯,但是你可以每天养成几个就好(除非他们是些坏习惯)。第二章介 绍了大部分你日常用到的编辑功能。你或许需要多次阅读他们,每次依照不同的重点阅读。例如:Emacs提供多种向前移动的方式:你可以向前移动一个字符,一个 单词,一行,一句话,一段话,一页,等等。所有这些方法都在第二章介绍。开始的时候学习如何向前向后移动,然后逐步增加更复杂的指令。同样,Emacs提供很多 不同的内容查找功能,这些会在第三章介绍。不要觉得应该一次就把他们掌握,找到一些内容,练习一下,然后再看下一个主题。在你习惯之前,你对前三章读了好几遍是不会有人报怨你的。把时间花在养成好习惯上是值得的。

阅读(363) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:学习GNU Emacs 3rd 1.2 理解文件和缓冲区

给主人留下些什么吧!~~