Skip to content

Miscellaneous tweaks

Tom Short edited this page Dec 7, 2021 · 4 revisions

Line movement with line wrapping on

With line wrapping, j and k provide movement between lines. It's nice to be able to move between display lines. That's the default with VS Code's up and down arrows. That's the way it works in insert mode. To move between display lines, you can redefine j and k as:

    {
        "key": "j",
        "command": "cursorDown",
        "when": "editorTextFocus && dance.mode == 'normal' && editorWordWrap"
    },
    {
        "key": "k",
        "command": "cursorUp",
        "when": "editorTextFocus && dance.mode == 'normal' && editorWordWrap"
    },

This is adapted from a similar issue with VSCodeVim. Line wrapping is especially common in Markdown files. The downside with this is that you lose Dance features. Moving by ten lines with 10k doesn't work. shift-j/k work differently.