文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>学习GNU Emacs 3rd 1.6 Emacs的指令

学习GNU Emacs 3rd 1.6 Emacs的指令

时间:2010-09-20  来源:nale

1.6. Emacs Commands 1.6. Emacs 指令
You're about to start learning some Emacs commands, so let's discuss them a bit first. How do you give commands? Each command has a formal name, which (if you're fastidious) is the name of a Lisp routine. Some command names are quite long; you usually wouldn't want to type the whole thing. As a result, we need some way to abbreviate commands.     现在开始学习一些Emacs的指令,那就先来讨论一下它们。你如何下指令?每个指令都有一个正式的名称,即(如果你很挑剔)Lisp程序的名称。
Emacs ties a command name to a short sequence of keystrokes. This tying of commands to keystrokes is known as binding. Even things you don't normally think about as commands, such as inserting the characters that you type, are handled through the binding mechanism. Keys like "A" are bound to the Emacs command self-insert-command, which inserts them into the buffer you are editing.[4] Most actions that you would normally think of as editor commands are bound to keystroke sequences starting with Ctrl or Meta. Emacs also binds some commands to mouse clicks (alone or modified by Shift or Ctrl) and to options on menus.     Emacs将一个命令的名称与一小串按键关联在一起。这种将命令与按键关联称为绑定。甚至一些你平时认为不是指令的东西,比如你打字时插入字符,会通过绑定机制被处理。比如“A”键被Emacs绑定到“自插入指令(self-insert-command)”,把它们插入到你正在编辑的缓冲区。【4】一般认为大部分编辑功能被定义成编辑器指令都会绑定到那些以Ctrl和Meta开头的击键序列。Emacs也将一些指令绑定到鼠标按键(单独的,或者与Shift,Ctrl一起)或者菜单选项。
[4] In certain special editing modes, such as dired-mode for viewing and manipulating directories on your computer, the normal typing keys don't insert themselves. They are instead bound to special commands that do things like opening and renaming files. This flexibility in defining and changing keymaps, while it might seem somewhat arbitrary and overwhelming at first, is one of the great sources of power in Emacs. 【4】在一些特定的编辑模式中,例如目录模式,在计算机上浏览操作目录,正常按键不会将键值插入进缓冲区。取而代之的是将它们绑定到特殊的指令例如打开文件,重命名文件等。当初始的键盘映射感觉比较随意或者压抑的,Emacs可以定义修改键盘映射是其强大的功能之一。
The authors of Emacs try to bind the most frequently used commands to the key sequences that are the easiest to reach. Here are the varieties of key sequences you'll encounter:     Emacs的作者试图将最常用的指令绑定到最容易够到的按键。你会遇到各种不同的按键序列:
The most commonly used commands (such as cursor movement commands) are bound to C-n (where n is any character). To press C-n, press and hold the Ctrl key and press n, then release both keys.     最常用的指令(光标移动指令)被绑定到C-n(n是任意字符)。要按C-n,先按住Ctrl键,再按n,然后松开两个键。
Slightly less commonly used commands are bound to M-n. To press M-n, press and hold the Meta key (usually next to the space bar), then press n.     次常用的指令被绑定到M-n。要按M-n,先按住Meta键(一般在空格键旁边),然后按n。
Other commonly used commands are bound to C-x something (C-x followed by something else—one or more characters or another control sequence). Among other types of commands, file manipulation commands, like the ones you are about to learn, are generally bound to C-x something.     其他常用指令绑定到C-x和其他按键(按完C-x然后按一个或多个键,抑或control与其他键的组合键)。在其他类型的指令中,如你将要学到的文件操作指令,一般都绑定到C-x和其他键的组合。
Some specialized commands are bound to C-c something. These commands often relate to one of the more specialized modes, such as Java mode or HTML mode. You won't encounter them until later in this book.     一些特殊的指令被绑定到C-c和其他键的组合。这些指令一般与比较特殊的模式相关,比如Java模式或者HTML模式。你会在本书的后部章节看到相关介绍。
This list still doesn't take care of all the possibilities. You can get at the remaining commands by typing M-x long-command-name Enter. (This works for any command really, but the keystrokes are usually easier to learn.)     这个列表仍旧没有顾及到所有的可能性。你可以按M-x键然后输入长长的指令名称再按回车键来执行剩下的指令。(这个方式适合任意的指令,但是还是快捷键更容易学习。)
You can define your own key bindings, too, and you should do so if you find yourself using the long form of a command all the time. More on this topic in Chapter 10.     你也可以自定义键绑定,当你总是在使用长格式的指令时就可以这么做。关于这个话题在第10章有详细介绍。
You can also access common commands through menus, but for maximum productivity, we recommend you learn the keystrokes, often given in parentheses following the menu option.     你也可以通过菜单访问常用指令,但是为了提高效率,我们建议你学习快捷键,在菜单中,各个选项后面会显示该选项对应的快捷键。
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载