Re: How to stop buffer number incrementing when writing to a temp file?

2015-04-05 Thread Justin M. Keyes
On Wed, Apr 1, 2015 at 10:23 AM,  b...@airbladesoftware.com wrote:
 Hello!

 I started this thread on vim_dev[1] and it was suggested I continue here 
 instead.

 I fail to understand, why this is a problem, but you should be able to work 
 around that using the writefile() function, which seems to be better suited 
 for such a case.

 Over the course of a day that VimL runs hundreds or thousands of times, and 
 when I only work on a dozen files it seems...inefficient that the buffer 
 number is up in the hundreds or higher.  It doesn't break anything but it's 
 an unwanted side-effect.

Isn't your use case mentioned in vim_dev, a perfect application of
tabs? Tabs have very predictable and stable numbering. It could be
argued that tabs exist in part to serve the use case you mention.

Buffers, in contrast, are the fundamental userland data structure in
Vim (and Emacs), so it is important that identity for a given buffer
is unique for the entire session.

For example, in the fugitive.vim plugin, the Glog command fills the
quicklist with buffer entries, and this will quickly increment your
buffer number to the hundreds or thousands. Instead of fighting this,
I say embrace it.

P.S. In the future I hope to see buffers made even more flexible and
useful in Vim, like Emacs...

Justin M. Keyes

-- 
-- 
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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to stop buffer number incrementing when writing to a temp file?

2015-04-05 Thread stillLearningVim
Hi Andy,

I'm not a vim expert, but it looks like we don't have a way to keep the buffer 
number from increasing. I haven't used vim's scratch buffer before, but maybe 
you can use that for editing a temp file.

From: http://vim.wikia.com/wiki/Vim_buffer_FAQ

Is it possible to configure Vim, by setting some option, to re-use the number 
of a deleted buffer for a new buffer?

No. Vim will not re-use the buffer number of a deleted buffer for a new buffer. 
Vim will always assign the next sequential number for a new buffer. The buffer 
number assignment is implemented this way, so that you can always jump to a 
buffer using the same buffer number. One method to achieve buffer number 
reordering is to restart Vim. If you restart Vim, it will re-assign numbers 
sequentially to all the buffers in the buffer list (assuming you have properly 
set 'viminfo' to save and restore the buffer list across Vim sessions).



-- 
-- 
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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.