question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Arrow keys to navigate within soft-wrapped text block.

See original GitHub issue

Thanks in advance. I’m sorry if this has an easy fix. I did spend quite a bit of time trying to find a solution or a configuration option and I hope I didn’t miss something trivial. I also poked around the Slack channel but must have joined at a slow time.

Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT maybe? Probably FEATURE REQUEST? What happened: See https://github.com/Microsoft/vscode/issues/34448 . The arrow keys don’t allow me to navigate among visual (soft-wrapped) lines in any mode. I have remapped j and k to gj and gk in non-insert modes, but in insert mode, I get around with the arrow keys.

What did you expect to happen: I expect (or at least wish) that navigation with arrow keys works as it does with vanilla VS Code. That is, I want to navigate up and down within soft-wrapped lines using the arrow keys (or at least have the option to enable it.)

How to reproduce it (as minimally and precisely as possible): Type a long line with soft wrap, and then try to navigate within it.

Environment: Ubuntu, Xmonad based custom desktop environment using Xorg.

  • Extension (VsCodeVim) version: v0.11.0
  • VSCode version: 1.20.1
  • OS version: 17.10.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
timtrocommented, Mar 6, 2018

On the Slack channel, some helpful people pointed out that I should avoid using the arrow keys anyway, as there are almost always better ways to move about in normal-mode. I think that’s largely true. Although I already use a lot of vim movement commands effectively, I’m compelled to work harder to build more effective habits when working in a very small neighbourhood of a file (where I would normally default to using arrows).

In the meantime, a suitable workaround is to rebind the keys. I tried this, of course, before posting the issue, but I didn’t know well enough to apply <C-o> first:

    "vim.insertModeKeyBindings": [
        {
            "before": ["<up>"],
            "after": ["<C-o>", "g", "k"]
        },
        {
            "before": ["<down>"],
            "after": ["<C-o>", "g", "j"]
        },
    ]

Thanks to @arussellk, @Nick and @chillee from the slack. https://vscodevim.slack.com/archives/C0ENQMTUM/p1520358214000115

1reaction
karlhorkycommented, Mar 25, 2019

Now that the documentation PR is open, you can probably close this one @timtro.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code, navigate within a wrapped line vs jumping to next line
In vs code I've noticed that when line wrap is enabled using the arrow keys to go to the next line causes the...
Read more >
Emacs: Visual Line Mode, Wrap Lines at Word Boundaries
Makes lines wrap at word boundaries. (controlled by var truncate-lines and word-wrap .) Makes up/down arrow keys move by a visual line.
Read more >
Trying to move away from arrow keys in normal/insert/visual ...
This is a good answer, but I disagree about hand position: Using arrow keys also requires resetting a hand, hence why it is...
Read more >
Soft wrapping text - Vimcasts
When wrap is enabled, each numbered line might be split across more than one display lines. The k and j keys move up...
Read more >
Word wrap - Visual Studio (Windows) - Microsoft Learn
The Show visual glyphs for Word Wrap option displays a return-arrow indicator where a long line wraps onto a second line. These reminder...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found