Buffer number explodes when :vimgrep is called.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Buffer number explodes when :vimgrep is called.

jrfranklin
Hello all,

When I call :vimgrep, I'll usually search a directory of 600-1000 files.  The number of unlisted buffers explodes after the call (I assume because buffers must be loaded into vim in order for the text to be searched).  Lately I've been using buffer numbers for navigation, but entering three-digit buffer numbers has become annoying. Is this property of :vimgrep able to be switched off with a Vim setting?  I'm surprised I can't find another instance of this question being asked online...

On the note of buffer numbers, is it advisable that I side-step using buffer numbers for navigation/file switching and find a better way?  What would more experienced users suggest?

Best,
Jason

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Buffer number explodes when :vimgrep is called.

Tony Mechelynck
On Wed, Feb 15, 2017 at 1:00 AM,  <[hidden email]> wrote:
> Hello all,
>
> When I call :vimgrep, I'll usually search a directory of 600-1000 files.  The number of unlisted buffers explodes after the call (I assume because buffers must be loaded into vim in order for the text to be searched).  Lately I've been using buffer numbers for navigation, but entering three-digit buffer numbers has become annoying. Is this property of :vimgrep able to be switched off with a Vim setting?  I'm surprised I can't find another instance of this question being asked online...
>
> On the note of buffer numbers, is it advisable that I side-step using buffer numbers for navigation/file switching and find a better way?  What would more experienced users suggest?
>
> Best,
> Jason

You could call them by filepathname instead. Or you could check the
list using :ls! (with bang) then use :bwipeout (not :bdelete) on any
of them you want to forget, and finally restart Vim. (Without
restarting the buffers will be forgotten but the next one will still
be after those three-digit buffer numbers.)

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Buffer number explodes when :vimgrep is called.

jrfranklin
Hi Tony!

I'm working on a plugin that relies on numbering the buffers in some way.  The idea is to make switching among them far easier.  I think I have it figured out... I'll just enumerate the buffers based on their relative position in the buffer list.  This will provide numbering that is consistent.

My only worry is that the user will get confused. The buffer "id" being used to reference a buffer specifically will be different from the buffer's numeric position in the buffer list, of course.  I think it will all turn out fine though.

Thanks!
Jason

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Buffer number explodes when :vimgrep is called.

Nikolay Aleksandrovich Pavlov
In reply to this post by jrfranklin
2017-02-15 3:00 GMT+03:00  <[hidden email]>:
> Hello all,
>
> When I call :vimgrep, I'll usually search a directory of 600-1000 files.  The number of unlisted buffers explodes after the call (I assume because buffers must be loaded into vim in order for the text to be searched).  Lately I've been using buffer numbers for navigation, but entering three-digit buffer numbers has become annoying. Is this property of :vimgrep able to be switched off with a Vim setting?  I'm surprised I can't find another instance of this question being asked online...
>
> On the note of buffer numbers, is it advisable that I side-step using buffer numbers for navigation/file switching and find a better way?  What would more experienced users suggest?

I like fuzzy-finder plugins for navigating buffers. Specifically I use
Command-T which requires +ruby, but there are lots of alternatives:
unite/denite, CtrlP, FUF, ku, constructing something on top of tlib, I
also saw a Command-T reimplementation in Python somewhere.

My workflow also suggests that I open all project file with a single
shell command and then use Command-T to navigate through
already-created (though not yet loaded, Vim does not load all files
specified on command-line immediately) buffers because scanning
filesystem of large projects sucks; or, at least, sucket last time I
bothered to use it in Command-T: zsh does scanning much faster (also
because it does not attept to scan absolutely everything: I have
specific globs) though yet it can’t beat `find` if you consider only
speed.

There is also a good replacement for :vimgrep: ag.vim uses less
verbose PCRE syntax (via ag aka the_silver_searcher), runs much faster
and will not load all files ag visits.

>
> Best,
> Jason
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Buffer number explodes when :vimgrep is called.

jrfranklin
Thanks for the suggestions.  I generally prefer not to rely too much on Plugins, but I have used Command-T and found it to be amazingly fast and useful.  If I were working on even larger projects, I'd make the switch for sure.

Jason

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.