且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

emacs绑定键插入另一个

更新时间:2022-12-10 19:44:17

命令。命令通常是交互式功能,但也可以是键盘宏(以字符串或向量格式)。执行键盘宏会导致Emacs执行宏的键序列将导致的事情。

Keys are bound to commands. Commands are usually interactive functions, but can also be keyboard macros (in either string or vector format). Executing a keyboard macro causes Emacs to do the things which the macro's key sequences would cause to be done.

(kbd>)导致键盘宏>;所以你告诉Emacs,当 C - 。键入时,应该执行> 被打字。

(kbd ">") results in the keyboard macro ">"; so you have told Emacs that when C-. is typed, it should do the things which are done when > is typed.

通常(在大多数缓冲区中)> 将被绑定 self-insert-command ,因此键盘宏(kbd>) em>只需插入> 字符,但您已修改该绑定。

Normally (in most buffers) > would be bound to self-insert-command, and therefore the keyboard macro (kbd ">") would simply insert a > character, but you've modified that binding.

我相信你想将 C - 。绑定到插入> 字符的命令。这样的命令是:

I believe you want to bind C-. to a command which inserts a > character. Such a command is:

(lambda () (interactive) (insert ">"))