我发现 mac 是支持 emacs 的一些快捷键的🤨

这样嘛,我知道 emacs 比 readline 早,

不过我对早期的NS是否支持这些快捷键表示怀疑(主要我印象中有哪儿提到过,Apple 是因为用了 readline ,而readline支持部分emacs的

readline 只适用于终端应用,而且是 GPL,苹果怎么可能用

这个嘛,和系统预装个 bash gcc 之类的一样当然是没问题的。

我继续翻了下旧文档

The text system uses a generalized key-binding mechanism that is completely re-mappable by the user, although defining custom key bindings dynamically (that is, while the application is running) is not supported. Key bindings are specified in an dictionary file that must have an extension of .dict ; the format of this file should be an XML property list, but the text system can also understand old-style (NeXT era) property lists. The standard key bindings are specified in /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict . These standard bindings include a large number of Emacs-compatible control key bindings, all the various arrow key bindings, bindings for making field editors and some keyboard UI work, and backstop bindings for many function keys.

重点是提到定义快揵的功能在 NeXT 就有了。

另外里面也讲了用户如何用配置文件更改这些绑定。

有篇文章讲了如何加上 C-x C-s 保存之类的绑定

http://www.hcs.harvard.edu/~jrus/Site/Cocoa%20Text%20System.html

苹果系统好像已经不预装 bash 和 gcc 了

据说换了 zsh

bash 目前还在,实际上比如有些软件安装脚本没改过来,默认 /bin/shbash (点名 iZotope),gcc 在有了 clang 以后就換了,zsh 倒是早就有了,新加上准备換 bash 的是 dash。

最大的变化是没 emacs 了。

macOS 目前仍然预装有一些 GNU 套件,包括 Bash、Texinfo 等。

但可能是因为许可证的原因,预装的都是 GPLv2 许可的旧版本。

不过,那些都是独立的程序,如果苹果在 AppKit 中用上 readline 就需要公布 AppKit 的源代码,而苹果肯定不干

对的,其实我认为直接影响 AppKit 的其实是 CMU 的 Hemlock 编辑器,和 GNU Emacs 关系可能不太大。

但是很早的 NeXT 系统就预装有 GNU Emacs

哇!挺好玩的

manjaro 甚至在 Tweaks下keyboard & Mouse 这项下,单独有个 Emacs Input 的设置,可以在浏览器输入中使用Emacs快捷键,但是像是Ctrl+n/p这种呢,就需要配合一些插件实现上下选择的功能了。

这个会不会和桌面有关,我记得gnome是可以直接选择emacs,kde的发行好像没有

我之前用kde想全局emacs按键没成功

可以用 xkeysnail 来实现 kde 的全局 emacs 按键
下面是我在用的配置:

对的,只能是gnome上可以。这也算是gnome的优点了,不然它大升级一次,扩展就挂一次的缺点,我咋能忍。