I would like visual-line-mode to be always on.

For this reason I put in the very end of my init.el file the following line of code (global-visual-line-mode 1) (as suggested here).

Anyway, the above code does not work and so. I still have to enable visual-line-mode for every buffer I need it.

How can I have it permanently on? Why is the above code not working?

  • The behavior you describe is not the default behavior as far as I am aware. With zero user-configuration (aka emacs -Q), please give us a step-by-step example of how you encounter the behavior you wish to change. And, tell us what version of Emacs you are using and what OS. In general, a minor-mode such as visual-line-mode will be enabled after a major-mode has been enabled. So, if a major-mode sets truncate-lines to t, the minor-mode of visual-line-mode will then come along and change truncate-lines to nil value. If a major-mode sets word-wrap to nil, the minor-mode .... – lawlist Oct 16 '18 at 1:50
  • you could try adding hooks temporarily till you find the conflicts in your config.. (add-hook 'prog-mode-hook 'turn-on-visual-line-mode) or (add-hook 'text-mode-hook 'turn-on-visual-line-mode) – junnu Oct 16 '18 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.