I have no experience with emacs.. I merely use it for just org mode.
But I did manage to permanently enable visual-line mode (aka proper line wrapping) globally, here is what i did:
The website OP mentioned (http://ergoemacs.org/emacs/emacs_long_line_wrap.html) instructs that the snippet
(global-visual-line-mode 1)
be written somewhere in the .emacs
file (which is in the usually in C:\Users\"your user name"\AppData\Roaming directory
).
I don't know where exactly to put that snippet in .emacs
file because, well, I am using Spacemacs so I edited the .spacemacs
file.
Towards the end of the text inside the .spacemacs
file there is the following code, where I added the additional line (global-visual-line-mode 1)
as shown:
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration.
This is the place where most of your configurations should be done. Unless it is
explicitly specified that a variable should be set before a package is loaded,
you should place your code here."
(global-visual-line-mode 1))
visual-line-mode
will be enabled after a major-mode has been enabled. So, if amajor-mode
setstruncate-lines
tot
, the minor-mode ofvisual-line-mode
will then come along and changetruncate-lines
tonil
value. If a major-mode setsword-wrap
to nil, the minor-mode ....(add-hook 'prog-mode-hook 'turn-on-visual-line-mode)
or(add-hook 'text-mode-hook 'turn-on-visual-line-mode)