Skip to content

Allow setting of keybindings for moving between visual lines in soft wrapped mode. #24

Description

@UsuallySleebee

Current Behaviour:
My current understanding is that when you set soft-wrapped mode, the keybindings for moving up and down lines (j, k) and moving between visual lines (gj, gk) are swapped so that (j, k) do visual lines and visa versa.

This doesn't work for if a user has rebound the H, J, K, L keybindings.

I use colemak for example, and these rebindings don't take place (or I'm somehow fundamentally misunderstanding that part of the plugin) because my movement keys are now on M, N, E, I.

Desired Behaviour:
I'd like it to default to switching (j, k) and (gj, gk) as normal, but allow an option in the settings for the plugin to say that I'd like my up and down keys in visual mode to be (n, e) instead of (j, k).

opts = {
    visual_line_up = "e",
    visual_line_down = "i".
}

use({
    "andrewferrier/wrapping.nvim",
    config = function()
        require("wrapping").setup(opts)
    end,
})

Then when enabling soft-mode wrapping those would be the bindings for moving visual lines and when disabling soft-mode wrapping, it would revert to what the bindings were before.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions