0

Running spacemacs 0.200.13 on emacs 25.2.2 on Kubuntu 18.04.

In ~/.spacemacs, there is:

(global-visual-line-mode t)
(add-hook 'text-mode-hook #'visual-line-mode)

So, when I open a text file, I see long lines as multiple screen lines.

But when I press j or k, it moves according to actual line, not screen line. That is, j or k moves multiple screen lines.

SPC h d k j shows j bound to evil-next-line

What is happening here? How do I get j and k to move as per screen line even in normal mode?

  • This seems like expected behaviour... Movement does indeed occur according to actual lines, not screen lines, when in the normal state. When entering insert state and using the arrow keys up and down, you should move according to the screen line. – EFLS Jun 4 '18 at 9:43
  • @EFLS Yes. I agree. Any idea how can one get the screen-line wise movement even in normal mode? – deshmukh Jun 5 '18 at 16:01
  • I think this is part of the vim emulation of evil. Since vim works with movements (characters, words, sentences, lines, etc.) rather than visual lines, I'd guess it is an indispensable part of the vim experience. I have to admit it was difficult to adopt this mindset at first, but once you get used to it, it becomes second nature. Make sure to learn the vim keys to move between sentences (( )), paragraphs ([ ]), words, etc. And also learn to use avy for easier movement. – EFLS Jun 7 '18 at 15:24
1

You want spacemacs/toggle-visual-line-navigation. In addition to turning on visual-line-mode, it rebinds j/k to evil-next/previous-visual-line.

  • Yes. That is what I do. But I thought, once done, it applies to all subsequent buffers/ sessions. – deshmukh Oct 9 '18 at 5:22
  • I've submitted a PR to add a global toggle. Assuming it makes it into the 0.300 release, you'll be able to do spacemacs/toggle-visual-line-navigation-globally. Until then, you should be able to survive by adding spacemacs/toggle-visual-line-navigation to your find-file-hook. – Matt Kramer Oct 11 '18 at 0:04

Your Answer

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

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