How to find a keyword over mulitiple files using VsVim

1.1k Views Asked by At

When using VsVim, the key combination CtrlF is accupied by VsVim itself and if you know vim it basically scrolls you forward in your text for approximately one page.

enter image description here

So I started to wonder if there is any feature in VsVim which can replace the traditional Quick Find in Visual Studio. If I want to search for a key-phrase using / then I only get the finds in the current file and missing the good ol Quick Find functionality which you could set Current Project or the Entire Solution to find the matches of what you have searched in the files that you haven't even opened already but may contain the word you're looking for.

Any suggestion? Appreciate it.

4

There are 4 best solutions below

0
On BEST ANSWER

VsVim gives you control over what it handles and what you let VsVim handle. I suggest you simply tell VsVim not to handle CTRL-F and use the Visual Studio behavior. This can be changed in Tools -> Options -> VsVim -> Keyboard. If you still need the Vim behavior of CTRL-F, you can use PageDown, or you can use CTRL-D to scroll down about a half-page.

1
On

You can try this plugin for Vim: https://github.com/skwp/greplace.vim

Basically, it allows you to type in a search phases (with/without regex) and ask you for the files to search in.

2
On

If VsVim is Vim, /foo is good for navigation but not really for searching.

To search for foo in the current file and display an actionnable list of results do:

:vim foo % | cw

To search recursively for foo in all *.py files under the working directory and display an actionnable list of results do:

:vim foo **/*py | cw

Vim doesn't know what a project is or what a solution is so I'm afraid you'll have to find your own abstraction for those things.

(edit)

So it looks like VsVim is not Vim after all, but maybe this entry in the FAQ will help you.

0
On

Ctrl+Shift+F will bring up the "Find and Replace" pop up window in which you can choose the scope of your search.