Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim CommandT- like search for strings

Is there a way in vim to search (grep/ack etc..) for strings in files in a similar fashion like one would do in CommandT?

So say that I invoke the search window. Possible matches for the string I wrote so far will start to show while I continue typing.

like image 488
tUrG0n Avatar asked Mar 16 '12 10:03

tUrG0n


2 Answers

I don't think there is any native (as in :set findasyoutype) way to do exactly what you want.

But there's a plugin for that ! Well, at least three:

  • LustyExplorer provides this feature through its :LustyBufferGrep command. It requires Vim to be compiled with Ruby support.
  • CtrlP too, provides this feature through the line extension.
  • You can also try FuzzyFinder which I've never used.
like image 160
romainl Avatar answered Oct 23 '22 02:10

romainl


I don't know how it looks like in CommandT, but if you issue the command :set incsearch (or put it in your .vimrc), once you search as usual, using /, vim highlights the first found item.

like image 22
nietaki Avatar answered Oct 23 '22 02:10

nietaki