Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to search and replace function for "vscode vim"?

i have tried but didnot find a way to search and replace in vscode with the vim keybindings plugin. The vim console doesn't take regular vims search and replace function :5,9s/foo/bar/g and vscode's default Ctrl+f doesn't work either as it is a vim binding.

like image 257
Lucas Avatar asked Mar 26 '19 08:03

Lucas


2 Answers

If you want to use VSCode's default search functionality while using the Vim extension, you need to configure the extension .

"vim.handleKeys": { "<C-f>": false }

Check the documentation for more information.

Regarding the actual vim search functionality, I cannot confirm it not working. The example you provided works on my end.

Input:

foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo

Running :5,9s/foo/bar/g results in:

foo
foo
foo
foo
bar
bar
bar
bar
bar
foo
foo
like image 185
Decay42 Avatar answered Sep 21 '22 05:09

Decay42


I have VSCode with Vim, and for me Ctrl+Shift+H works equivalent to Ctrl+F without Vim. For returning back to the file, press Ctrl+Tab.

like image 27
Zumitify Avatar answered Sep 20 '22 05:09

Zumitify