I am looking for some command like:
:b1!g/something_here/
where I supposedly search for a word "something_here" in the buffer "b1". How can I do it?
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.
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.
vi has 26 buffers, named ``a'' through ``z'', where it can store text temporarily. You can use buffers to: store text for insertion elsewhere in the current file.
I often do:
:rew
:bufdo 0
:bufdo g/something here/
:ls
The last :ls allows me to see all the buffers that are not positioned on line 1
Well, go to buffer b1 and
:g/something here/
For searching through all open buffers there are various plugins, for which I think would be best if you took a peek on www.vim.org
Edit: like this one - buffergrep
And my personal favorite for all kinds of searching: compview
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