I'd like to search for text in all files currently open in vim and display all results in a single place. There are two problems, I guess:
:grep
/:vim
, especially the names of files that aren't on the disk;:grep -C 1 text
doesn't look good in the quickfix window.Here is a nice example of multiple file search in Sublime Text 2:
Any ideas?
Pressing Alt-F12 opens a window listing the buffers, and you can press Enter on a buffer name to go to that buffer. Or, press F12 (next) or Shift-F12 (previous) to cycle through the buffers.
Just put it to your . vim/plugin directory and then use :BufOnly command to close all buffers but the active one.
You can quit from all open files (buffers) by :qa or :qa! In vim. The exclamation mark means to force quit the edited unsaved file.
Whenever you delete something from a file, vi keeps a copy in a temporary file called the general buffer. You can also delete or copy lines into temporary files called named buffers that will let you reuse those lines during your current vi work session.
Or
:bufdo vimgrepadd threading % | copen
The quickfix window may not look good for you but it's a hell of a lot more functional than ST2's "results panel" if only because you can keep it open and visible while jumping to locations and interact with it if it's not there.
ack and Ack.vim handle this problem beautifully. You can also use :help :vimgrep
. For example:
:bufdo AckAdd -n threading
will create a nice quickfix window that lets you hop to the cursor position.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With