gpt4 book ai didi

emacs - 在 Emacs 中修改光标下的面,包括在 ansi-term 上

转载 作者:行者123 更新时间:2023-12-01 07:47:26 25 4
gpt4 key购买 nike

有没有办法轻松修改光标下的font-face

例如,下面的蓝色文字很难阅读:

                          enter image description here

以上是

的输出
ipython --color "Linux"

Emacs 24.1 中使用 tango-darkansi-term 上运行,即 (load-theme 'tango-dark t)

如果我在上面的图像上运行 what-c​​ursor-position(此处描述:Get font face under cursor in Emacs),我得到:

             position: 30385 of 30477 (100%), column: 22
character: / (displayed as /) (codepoint 47, #o57, #x2f)
preferred charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x2F
syntax: _ which means: symbol
category: .:Base, a:ASCII, l:Latin, r:Roman
buffer code: #x2F
file code: #x2F (encoded by coding system nil)
display: by this font (glyph code)
xft:-unknown-DejaVu LGC Sans Mono-bold-normal-normal-*-11-*-*-*-m-0-iso10646-1 (#x12)

Character code properties: customize what to show
name: SOLIDUS
old-name: SLASH
general-category: Po (Punctuation, Other)
decomposition: (47) ('/')

There are text properties here:
face (:weight bold :foreground "blue2" :background unspecified)

如何修改此字体?

如果您想知道 IPython 仅支持三种颜色集:

  • 无色
  • Linux(我上面使用的那个)
  • LightBG(用于浅色背景)

更新:

我认为 font-lock-string-face 是另一张脸:

                       enter image description here

事实上,我认为这不是 IPython 用来表示字符串的面,而是 python-mode 用常规 python 代码(在 tango 中)用来表示缓冲区中字符串的面-dark) -- 见下文 --.

                                        enter image description here

最佳答案

M-x customize-face 将光标悬停在您要修改的特定内容上。 set-face-foregroundset-face-background 也可用,这取决于您想要做什么(有时最好更改背景颜色以使字体更容易见终端)。

所以我检查了 IPython,正如我在下面的评论中提到的那样,ipython.el 并没有突出显示它自己。着色都是使用终端 ANSI 颜色完成的。在某些终端中,可以通过 .bashrc.zshrc 或任何您的 shell 更改颜色,并可能从 M-x term 运行它。通过 Emacs 本身,我看不到更改它的方法,因为 IPython 只有 3 个默认方案,并且据我所知无法指定任何特定的内容。

关于emacs - 在 Emacs 中修改光标下的面,包括在 ansi-term 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14510580/

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