How can I make emacs highlight lines that go over 80 chars?

后端 未结 8 1554
不思量自难忘°
不思量自难忘° 2020-12-01 02:18

I know there are solutions to making emacs show the 80 line column, but I don\'t want that sort of visual disturbance. I\'d just like to make it highlight a line if it\'s ov

8条回答
  •  既然无缘
    2020-12-01 02:41

    There is a built-in package in emacs-goodies-el(recommend to install it in terminal) called highlight-beyond-fill-column.el, add this to your .emacs or init.el:

    (setq-default fill-column 80)
    (add-hook 'prog-mode-hook 'highlight-beyond-fill-column)
    (custom-set-faces '(highlight-beyond-fill-column-face
                        ((t (:foreground "red" )))))
    

    The text beyond fill-column which is 80 in the snippet will be highlighted with the color of red. You can set the face as you like.

提交回复
热议问题