-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Describe the bug
When using VSCodeVim, a standard Vim visual-mode mapping for // that yanks the selection and searches for it fails with E486: Pattern not found: \Vescape(@",'/').
The same mapping works correctly in regular Vim on Linux. In VSCodeVim, it appears that the expression register part of the mapping (=escape(@",'/')) is not being evaluated, and is instead treated as literal text in the search pattern.
Minimal mapping:
vnoremap // y/\V=escape(@",'/')
To Reproduce
Steps to reproduce the behavior:
- Open any text file in VSCode with VSCodeVim enabled.
- Add the following to your VSCodeVim configuration (e.g. vimrc used by the extension): vnoremap // y/\V=escape(@",'/')
- Visually select some text (e.g. v or V, then move the cursor).Press //
- Observe that instead of searching for the selected text, an error is shown:
E486: Pattern not found: \Vescape(@",'/')
Expected behavior
Execute the search and move the cursor to the next occurrence of the selected text.
In other words, behavior should match regular Vim on Linux, where this mapping works as intended.
Screenshots
If applicable, add screenshots to help explain your problem.
If remapping-related, please attach log output: https://github.com/VSCodeVim/Vim#debugging-remappings.
Environment (please complete the following information):
- Extension (VsCodeVim) version: 1.32.2
- VSCode version: Cursor 2.1.50
- OS: Windows 11
Additional context
Add any other context about the problem here.