How to search and replace function for "vscode vim"?
Asked Answered
M

4

14

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.

Meadowsweet answered 26/3, 2019 at 8:27 Comment(1)
I am using this vim plugin: github.com/VSCodeVim/Vim.Meadowsweet
W
21

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
Waterlogged answered 26/3, 2019 at 8:50 Comment(0)
I
4

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.

Infernal answered 22/4, 2022 at 7:39 Comment(0)
G
2

The extension "vscodevim" v1.21.10 does support regular vim search and replace functions such as:

:%s/"/'/g
Gentianella answered 22/1, 2022 at 10:59 Comment(1)
thx mate, this one worked, :s/"/'/g didn'tColic
S
0

In VSCodeVim, many Ex-commands require Neovim integration.

Setup:

  1. Install Neovim
  2. Enable Neovim via vim.enableNeovim
  3. Set the Neovim path via vim.neovimPath
Sydel answered 27/7, 2020 at 21:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.