Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Add option to disable behavior "Enter Visual Mode on VSCode Find (Ctrl F)"

Open awvalenti opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. I'm always frustrated when I open VSCode Find (Ctrl F), type my stuff and VsCodeVim enters Visual Mode. This makes me have to press ESC twice, once to close Find box, another one to leave Visual Mode.

Describe the solution you'd like Add option to disable behavior "Enter Visual Mode on VSCode Find (Ctrl F)"

Describe alternatives you've considered Can't think of anything else. Changing the default behavior doesn't seem reasonable to me in principle.

Additional context Peek 28-02-2024 10-47

awvalenti avatar Feb 28 '24 13:02 awvalenti

Honestly this seems like it should be the default behavior. The vim-native search doesn't switch to visual mode either when navigating results so why should the VSCode built-in search be any different?

diminutivesloop avatar Oct 12 '25 01:10 diminutivesloop

Quick workaround: the root cause seems to be this line: https://github.com/VSCodeVim/Vim/blob/3f1ad54250c88020e7df3e1e326f4797363fdd8c/src/mode/modeHandler.ts#L268

If I comment that out, rebuild the extension, and install it locally, I can use VS Code’s Find and Command-P with % searches without it ever entering Visual mode.

I considered opening a PR, but several tests fail related to selection growth. That’s a feature I rarely use compared to grep-style search, so I’m OK living with the trade-off locally.

Ideally this can be fixed upstream so both behaviors work.

Note: pressing ESC after a search would be tolerable, but the bigger issue is that any tab with a match also switches to Visual mode, so you end up hitting ESC every time you change files."

baz-sh avatar Nov 12 '25 12:11 baz-sh

Honestly this seems like it should be the default behavior. The vim-native search doesn't switch to visual mode either when navigating results so why should the VSCode built-in search be any different?

TBH, I don't remember why I said that "Changing the default behavior doesn't seem reasonable (...)". Actually, it's pretty obvious to me that visual mode should NOT be automatically enabled when a search is done. If it's feasible to change the default behavior to preserve current mode during searches, it's preferable. If it's not feasible, then, yes, a new option could be created (opt-out fashion).

awvalenti avatar Nov 12 '25 18:11 awvalenti