How to open .org and .txt files with visual-line-mode automatically turned on?
Also, is there a way to configure cursor-movement so that cursor moves as if the visual line where a logical line? line-move-visual is not effecting Spacemacs evil mode keybindings: k (line up), j (line down).
I am running Emacs 25.2.1, with Spacemacs, evil mode, org-mode on Linux.
UPDATE 1
From .spacemacs file, after adding visual-line-mode
(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."
)
(add-hook 'org-mode-hook #'visual-line-mode)
(add-hook 'text-mode-hook #'visual-line-mode)
(setq org-use-speed-commands t)
;; Do not write anything past this comment. This is where Emacs will
;; auto-generate custom variable definitions.
(custom-set-variables
With emacs open to a txt file:
SPC h d k k
k runs the command evil-previous-line (found in evil-motion-state-map), which is
an interactive compiled Lisp function in ‘evil-commands.el’.
It is bound to <up>, k.
SPC h d v line-move-visual
line-move-visual is a variable defined in ‘simple.el’.
Its value is t
UPDATE 2
Tobias's advices code worked great; j and k move cursor as if the visual line where a logical line.
Then I installed org-drill. And org-drill worked fine until I restarted Emacs, then Emacs said:
Spacemacs encountered an error while loading your '~/.spacemaces' file.
Pick your editing style for recovery:
vim
emacs
hybrid
When I completed the recovery, org-drill was missing from M-x, so I reinstall org-drill. Then restarting Emacs encountered the same error. So I removed Tobias's advices code from my .spacemacs file, and now Emacs and org-drill work fine.
UPDATE 3
I placed the new eval-after-load advices code in ~/.spacemacs. And Emacs started without errors. But long lines of text in .org file did not wrap at all.
So then I restored the previous advices code in ~/.spacemacs.
And started Emacs from the terminal: emacs --debug-init.
There where error messages.
How to copy them to clipboard? Screen shot of error messages: