Mac OS X终端下的emacs中的home / end控制字符不起作用 [英] Home / end control characters don't work in emacs under Mac OS X terminal

查看:115
本文介绍了Mac OS X终端下的emacs中的home / end控制字符不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Mac OS X的终端窗口中运行emacs。从同一终端的bash shell,我可以使用 Shift +< Home> Shift +< end> 分别转到行的开头和结尾。当我在emacs里面时,这些都不行。我收到错误:

  M- [h未定义

  M- [f未定义

这是emacs还是终端模拟器的错误?我可以看到如何更改终端发送的控制字符,但是据我所知,这些控制字符是正确的控制字符发送(并且它在emacs之外)

解决方案

将这些放在你的.emacs中:

 (全局设置键(kbdM- [h)'开始行)
(全局设置键(kbdM- [f)'行尾)


I'm running emacs from within a terminal window on Mac OS X. From the bash shell at the same terminal, I can use Shift + <Home> and Shift + <end> to go to the beginning and end of the line respectively. When I'm inside emacs, these don't work. I get the error:

M-[ h is undefined

and

M-[ f is undefined

Is this the fault of emacs or the terminal emulator? I can see how to change the control characters that the terminal sends, but as far as I can tell these are the right control characters to send (and it works outside of emacs).

解决方案

Put these in your .emacs:

(global-set-key (kbd "M-[ h") 'beginning-of-line)                                 
(global-set-key (kbd "M-[ f") 'end-of-line) 

这篇关于Mac OS X终端下的emacs中的home / end控制字符不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆