emacs - 在较大的换行行中突出显示一行

标签 emacs

<分区>

在 emacs 中使用自动换行时,长行可以换行成较短的行。 hl-line 次要模式似乎突出显示了整个换行。

我只想突出显示光标当前所在的一行。在屏幕截图中,这将是第一行。

Screenshot

我必须更改哪个设置?

最佳答案

hl-line 模式允许在 hl-line-range-function 中设置自定义行定义函数。该函数决定一行从哪里开始和结束。只需将其设置为适当的值即可:

(defun visual-line-range ()
  (save-excursion
    (cons
     (progn (beginning-of-visual-line) (point))
     (progn (end-of-visual-line) (point)))))

(setq hl-line-range-function 'visual-line-range)

瞧。

关于emacs - 在较大的换行行中突出显示一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31541907/

相关文章:

emacs - 重新绑定(bind) Emacs 中的键以更改源代码中的注释样式

emacs 多键绑定(bind)

emacs - 如何减少emacs中的全屏模式

emacs - 如何防止 emacs 在批处理模式下切断堆栈跟踪?

Emacs 25 从带有键盘的 x windows PRIMARY 剪贴板缓冲区中拉出

emacs - 在左上角初始化 Emacs

emacs - 在 emacs org-mode 中导出时如何评估所有代码块

emacs - 在面向 Jekyll 的 org-mode 博客文章中编辑 YAML frontmatter

Emacs 取消绑定(bind)模式的 KeyBinding

emacs - 使用 "next-error"和 "previous-error"循环结果