In doom emacs, by default (when starting from the default configuration), visual-line-mode and word-wrap enabled in fundamental, text, prog modes...

I would like to disable the visual-line-mode by default and keep word-wrapping. This works when I do M-x visual-line-mode, and I have the desired effect:

enter image description here

However I don't know how to do it properly to disable it by default. Few attempts:

  1. adding in config.el:

    (global-visual-line-mode 0)
    (visual-line-mode 0)

    doesn't make any effect

  2. Adding the following hook disables word wrapping, and subsequent call to (toggle-word-wrap) doesn't work:

    (add-hook 'text-mode-hook (lambda () (visual-line-mode 0)))

    so overall the effect is wrong (note: the lines are not unfolded): enter image description here:

1 Answer 1


The docs for global-visual-line-mode say:

If called from Lisp, toggle the mode if ARG is ‘toggle’. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

So try

(global-visual-line-mode -1)
  • doesn't work. By some reason Doom Emacs keeps setting both variables (visual-line-mode and global-visual-line-mode) to t. Jan 2, 2022 at 23:26
  • @RobertZaremba did you manage to do this?
    – edmz
    May 26, 2022 at 18:02
  • This is what I'm using: (global-visual-line-mode 0) (add-hook 'prog-mode-hook (lambda () (toggle-truncate-lines 0))) May 26, 2022 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.