gpt4 book ai didi

perl - Emacs中未移位的符号

转载 作者:行者123 更新时间:2023-12-04 13:24:40 26 4
gpt4 key购买 nike

我想要一个次要模式,该模式允许以不变的方式访问数字键上的移位符号(然后对数字进行移位)。似乎这对Perl代码($,@,%等)很有帮助。理想情况下,有一个切换此模式的键。有点像大写锁定,但仅用于数字键。

这样的模式已经存在吗?

最佳答案

自己滚动的一种方法是这样的:

(define-minor-mode snoopy-mode
"Toggle snoopy mode.
With no argument, this command toggles the mode.
Non-null prefix argument turns on the mode.
Null prefix argument turns off the mode."
;; The initial value.
nil
;; The indicator for the mode line.
" Snoopy"
;; The minor mode bindings.
'(("1" . (lambda () (interactive) (insert-char ?! 1)))
("!" . (lambda () (interactive) (insert-char ?1 1)))
;;etc
))

参见 minor modeskeymaps

关于perl - Emacs中未移位的符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6277813/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com