Emacs问题 - 哈希键 [英] Emacs question - hash key

查看:107
本文介绍了Emacs问题 - 哈希键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台Mac笔记本电脑,我正在连接到运行Linux的服务器。由于Alt + 3已经在EMACS中绑定到一个命令,所以我无法在文件中插入散列符号。
我已经尝试了以下在线找到的解决方案:

 (global-unset-key(kbdC-3 ))
(global-set-key(kbdC-3)'(lambda()(interactive)(insert-string
#)))//我知道C是对于CTRL不是Alt - 我已经尝试与
M-3而不是

和一些其他人也是,但没有一个似乎工作。你可以告诉我任何
其他方式,我可以在
文件中输入哈希号(#)。



(没有工作):

 (fset'insertPound#)
(全局设置键M-3)'insertPound)

谢谢!

解决方案

我假设你有一个Mac UK键盘,所以 Shift - 3 是£。在其他大多数键盘上, Shift - 3 是其他人所说的。



将输入源更改为澳大利亚,唯一的区别是 Shift - 3 现在是#和 Alt - 3 是$(或作为emacs绑定)



输入源设置
是系统偏好设置 - >语言和文本 - >输入源

在以后的OSX版本(OSX 10.11肯定但早先已经)输入源设置是系统首选项 - >键盘 - >输入源默认情况下,这将只显示英国键盘,以查看更多的列表底部的+添加澳大利亚



我喜欢这个而不是在emac中添加代码的原因是 Shift - 3 是#所有应用程序包括Xcode / Eclipse,所以我不需要根据应用程序切换密钥,或者根据我在美国键盘或Windows / Linux等上的切换。


I have a Mac Laptop and I am connecting to server running Linux. As Alt+3 is already bound in EMACS to a command, so I cannot insert the hash symbol in a file. I have tried the following solution I found online:

(global-unset-key (kbd "C-3"))
(global-set-key (kbd "C-3") '(lambda() (interactive) (insert-string
"#")))      //I know that C is for CTRL not Alt - I have tried with
M-3 instead as well

and some others as well, but none seem to work. Can you tell me any other way in which I might be able to enter the hash sign (#) in a file.

Aso tried (did not work):

(fset 'insertPound "#")
(global-set-key (kbd "M-3") 'insertPound)

Thank you!

解决方案

I assume that you have a Mac UK keyboard so Shift-3 is £. On most other keyboards Shift-3 is # as others have said.

The way I get round it is to change the input source to Australian the only difference is that Shift-3 is now # and Alt-3 is £ (or leave as the emacs binding)

Input Source setting was System Preferences->Language&text->Input Source
On later OSX versions (OSX 10.11 definitely but would have been earlier) Input Source setting is System Preferences->Keyboard->Input Source By default this will just show the UK keyboard to see more hit the + at the bottom of the list and add Australian

The reason I prefer this rather than adding code in emacs is that Shift-3 is # for all apps e.g. including Xcode/Eclipse so I don't have to switch the key according to the app or according to wether I am on a US keyboard or on Windows/Linux etc.

这篇关于Emacs问题 - 哈希键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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