VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
13.95k stars 1.32k forks source link

When swapping 'h' and 'f' visual mode will not move left with 'f', only 'h' (recent regression) #2855

Closed lukedegruchy closed 6 years ago

lukedegruchy commented 6 years ago

Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

What happened:
Swapping h and f results in 'f' failing to move the selection left and 'h' needed to do so. This is a regression from VSCode 1.2.2 (and possibly more recent versions as well).

What did you expect to happen: 'f' should move the selection left when in visual mode. This is the case with GVim, SublimeText, IdeaVim, and VSCode 1.2.2.

How to reproduce it (as minimally and precisely as possible): Add this to settings.json:

    "vim.normalModeKeyBindingsNonRecursive": [
            {
                "before": ["h"],
                "after": ["f"]
            },
            {
                "before": ["f"],
                "after": ["h"]
            }
        ],

Work on a line with some text and enter visual mode. Try to move the selection left with 'f' instead of 'h'.

Environment:

xconverge commented 6 years ago

Currently vim.visualModeKeyBindings is separate so you will need to duplicate your binding for visual mode as well

lukedegruchy commented 6 years ago

I confirm that the solution as suggested works, meaning, to add the below config in addition to that in the bug description:

    "vim.visualModeKeyBindings": [
        {
            "before": ["h"],
            "after": ["f"]
        },
        {
            "before": ["f"],
            "after": ["h"]
        }
    ],