gpt4 book ai didi

emacs - 如何在指定模式下禁用 hl-line 功能

转载 作者:行者123 更新时间:2023-12-04 11:12:32 27 4
gpt4 key购买 nike

我使用以下代码在全局范围内启用 hl-mode。

(global-hl-line-mode t) 

在指定模式下关闭 hl-line 功能。我用下面的代码来做。
(add-hook 'org-mode-hook (lambda () (global-hl-line-mode 0)))

但它会关闭全局范围的 hl-line 功能。

如何在指定模式下禁用 hl-line 功能?

最佳答案

Commentary中经常有信息和文档。
源文件中的部分。

[...]
;; You could make variable `global-hl-line-mode' buffer-local and set
;; it to nil to avoid highlighting specific buffers, when the global
;; mode is used.
[...]

因此,您可以在 .emacs 中放入类似的内容。 .
(global-hl-line-mode)
(make-variable-buffer-local 'global-hl-line-mode)
(add-hook 'some-mode-hook (lambda () (setq global-hl-line-mode nil)))
...

关于emacs - 如何在指定模式下禁用 hl-line 功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9990370/

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