Buffer Sorting

10 messages
Open this post in threaded view
|

Buffer Sorting

 Hi, If i have a large number of buffers that i've opened over time in a Vim session. Is there an easy way to renumber them so that they are numbered in alphabetical path order? e.g. if :buffers was: 1 h "base/three.c" 3 h "base/one.c" 5 h "plugin/two.c" 7 h "alpha/test.c" I'd like to type command and get :buffers 1 h "alpha/test.c" 2 h "base/one.c" 3 h "base/three.c" 4 h "plugin/two.c" Cheers for any help, Dom
Open this post in threaded view
|

RE: Buffer Sorting

 From :help buffer   Each buffer has a unique number.  That number will not change,   so you can always go to a specific buffer with ":buffer N" or Thus, What you are asking for is not possible without opening the files in the order you want the numbers to be assigned. -Rajesh -----Original Message----- From: Dominic Evans [mailto:[hidden email]] Sent: Thursday, September 15, 2005 5:33 PM To: vim mailing list Subject: Buffer Sorting Hi, If i have a large number of buffers that i've opened over time in a Vim session. Is there an easy way to renumber them so that they are numbered in alphabetical path order? e.g. if :buffers was: 1 h "base/three.c" 3 h "base/one.c" 5 h "plugin/two.c" 7 h "alpha/test.c" I'd like to type command and get :buffers 1 h "alpha/test.c" 2 h "base/one.c" 3 h "base/three.c" 4 h "plugin/two.c" Cheers for any help, Dom
Open this post in threaded view
|

Re: Buffer Sorting

 Yes but, assumedly one could store the list of files in a variable, unload all the buffers, and then open all the files in the required order? Thats the sort of thing I was expecting really. Cheers, Dom On 15/09/05, Goli, Rajesh (Rajesh) <[hidden email]> wrote: > From :help buffer > > Each buffer has a unique number.  That number will not change, > so you can always go to a specific buffer with ":buffer N" or > > Thus, What you are asking for is not possible without opening the files in > the order you want the numbers to be assigned. > > -Rajesh > > -----Original Message----- > From: Dominic Evans [mailto:[hidden email]] > Sent: Thursday, September 15, 2005 5:33 PM > To: vim mailing list > Subject: Buffer Sorting > > > Hi, > > If i have a large number of buffers that i've opened over time in a > Vim session. Is there an easy way to renumber them so that they are > numbered in alphabetical path order? > > e.g. > > if :buffers was: > > 1 h "base/three.c" > 3 h "base/one.c" > 5 h "plugin/two.c" > 7 h "alpha/test.c" > > I'd like to type command and get > :buffers > > 1 h "alpha/test.c" > 2 h "base/one.c" > 3 h "base/three.c" > 4 h "plugin/two.c" > > Cheers for any help, > Dom >
Open this post in threaded view
|

Re: Buffer Sorting

 In reply to this post by Dominic Evans Does this list the buffers in alphabetical order in its window then? On 15/09/05, R. shankar <[hidden email]> wrote: >  Dominic, > >   I think you are looking at a way to go to buffer quickly and feels that, > if the buffers are arranged alphabetically it would be helpful. >   You could use the Buffer Explorer plugin to do this. >       Using simple commands like \be opens the explorer. You could the > buffer either in the alphabetical way or in the asc/des order of the buffer > numbers. >       Pressing the Enter on a buffer name would take to that buffer. > > Hope this is what you are looking for. >   > > Regards, > shankar > >   > Hi, > > If i have a large number of buffers that i've opened over time in a > Vim session. Is there an easy way to renumber them so that they are > numbered in alphabetical path order? > > e.g. > > if :buffers was: > > 1 h "base/three.c" > 3 h "base/one.c" > 5 h "plugin/two.c" > 7 h "alpha/test.c" > > I'd like to type command and get > :buffers > > 1 h "alpha/test.c" > 2 h "base/one.c" > 3 h "base/three.c" > 4 h "plugin/two.c" > > Cheers for any help, > Dom > > > > > > > > > > > >  -- > R.SHANKAR , SMTS, TRANSWITCH > C/o, R.S.Rana, > Flat No 2, First Floor, House No. 212A/1 > Baba Ganga Nath Market, Near community Hall, > Munirka Village New Delhi . PIN : 110067 > PH(OFFICE): +(91)(11)26165111, Mobile: 9899125114 > PH(RES): (91)(11)26161875 > Email: [hidden email], [hidden email] >     > > > > > >
Open this post in threaded view
|

Re: Buffer Sorting

 In reply to this post by Dominic Evans On Thu, Sep 15, 2005 at 01:02:42PM +0100, Dominic Evans wrote: > Hi, > > If i have a large number of buffers that i've opened over time in a > Vim session. Is there an easy way to renumber them so that they are > numbered in alphabetical path order? As other people have already mentioned, this isn't possible without loading the files in the given order.  You may be interested in the bufexplorer plugin which provides a list of the buffers you have open.  The plugin allows you to sort this list by: - Most Recently Used - Fullpath - Buffer number - Filename HTH, James -- GPG Key: 1024D/61326D40 2003-09-02 James Vega <[hidden email]> attachment0 (204 bytes) Download Attachment
Open this post in threaded view
|

RE: Buffer Sorting

 In reply to this post by Dominic Evans   Not possible to change the numbers of the buffers, but possible to see them sorted alphabetically:   see http://www.vim.org/tips/tip.php?tip_id=976  (The latest version is toward the bottom.) --Suresh -----Original Message----- From: Dominic Evans [mailto:[hidden email]] Sent: Thursday, September 15, 2005 5:03 AM To: vim mailing list Subject: Buffer Sorting Hi, If i have a large number of buffers that i've opened over time in a Vim session. Is there an easy way to renumber them so that they are numbered in alphabetical path order? e.g. if :buffers was: 1 h "base/three.c" 3 h "base/one.c" 5 h "plugin/two.c" 7 h "alpha/test.c" I'd like to type command and get :buffers 1 h "alpha/test.c" 2 h "base/one.c" 3 h "base/three.c" 4 h "plugin/two.c" Cheers for any help, Dom