Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visual-line-mode doesn´t work as expected with evil enabled #1960

Open
omidmash opened this issue Feb 11, 2025 · 6 comments
Open

visual-line-mode doesn´t work as expected with evil enabled #1960

omidmash opened this issue Feb 11, 2025 · 6 comments

Comments

@omidmash
Copy link

Doom Emacs:

C h v visual-line-mode is t. The lines in my .org text (the buffer where it's enabled) do get wrapped, however, pressing j k only moves up and down in a logical manner, and not in a visual manner. When evil mode is disabled, this doesn´t happen. I tried doom upgrade. The issue persists.

@tomdl89
Copy link
Member

tomdl89 commented Feb 11, 2025

What value do you have for evil-respect-visual-line-mode?

@omidmash
Copy link
Author

nil. I changed it manually with (setq evil-respect-visual-line-mode t) to t, the behavior doesn´t change.

@tomdl89
Copy link
Member

tomdl89 commented Feb 11, 2025

Ah, this is a bit of a gotcha in evil. The code that swaps the keybindings in evil is only called once, when evil is loaded:
https://github.com/emacs-evil/evil/blob/master/evil-integration.el#L434-L445
so it looks like you'll need to set this before loading evil in your init.el (or using the :init keyword in use-package).

@omidmash
Copy link
Author

Neither

(use-package-hook! evil
  :pre-init
  (setq evil-respect-visual-line-mode t)
  t)

nor

(use-package-hook! evil
  :pre-init
  (setq evil-respect-visual-line-mode t))

or

(use-package-hook! evil
  :pre-config
  (setq evil-respect-visual-line-mode t))

works unfortunately. Now this is a dooms package manager issue I believe, because C h v evil-respect-visual-line-mode still shows nill.

@tomdl89
Copy link
Member

tomdl89 commented Feb 11, 2025

Yeah, I'm not a Doom user, so can't help you there. But this issue does make me think we should make this easier in evil anyway. We could make it so setting at any time could enable this functionality. Worth a look. Not sure when I'll get to it, but hopefully soon.

@omidmash
Copy link
Author

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants