Patch to try out: v:oldfiles

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Patch to try out: v:oldfiles

Bram Moolenaar
Now and then I start editing a file and want to go back to a file I
edited in a previous edit session.  But the name doesn't appear in the
marks or buffer list.  Still, I know the file name is in the viminfo
file.  There are plugins for this, but I thought it would be nice if Vim
could retrieve file names natively.

The idea is simple: when reading the viminfo file on startup, store the
file names from the list of buffer marks in v:oldfiles.  This already
makes it possible to use them.  For convenience I added the ":oldfiles"
command to list them (nicer than ":echo v:oldfiles").  And the #<N item
to be able to use the file name in most places on the command line.

Please try the patch and tell me what you think.

-
ERROR 047: Keyboard not found.  Press RETURN to continue.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


oldfiles_patch.diff (31K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Patch to try out: v:oldfiles

JohnBeckett

Bram Moolenaar wrote:

> Now and then I start editing a file and want to go back to a
> file I edited in a previous edit session.  But the name
> doesn't appear in the marks or buffer list.  Still, I know
> the file name is in the viminfo file.  There are plugins for
> this, but I thought it would be nice if Vim could retrieve
> file names natively.
>
> The idea is simple: when reading the viminfo file on startup,
> store the file names from the list of buffer marks in
> v:oldfiles.  This already makes it possible to use them.  For
> convenience I added the ":oldfiles"
> command to list them (nicer than ":echo v:oldfiles").  And
> the #<N item to be able to use the file name in most places
> on the command line.
>
> Please try the patch and tell me what you think.

Bram - I think there is a glitch in the patch that you attached. It looks like a
couple of lines are missing -- lines that should say that runtime/doc/starting.txt
is being patched.

I've just tried building with this patch. I haven't done any testing yet, but the
patch fails because it is trying to patch eval.txt with hunks intended for
starting.txt.

I use Yegappan Lakshmanan's wonderful mru.vim for tracking recently-used files, but
some built-in support would be great.

John


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

RE: Patch to try out: v:oldfiles

Bram Moolenaar
> Bram Moolenaar wrote:

> > Now and then I start editing a file and want to go back to a
> > file I edited in a previous edit session.  But the name
> > doesn't appear in the marks or buffer list.  Still, I know
> > the file name is in the viminfo file.  There are plugins for
> > this, but I thought it would be nice if Vim could retrieve
> > file names natively.
> >
> > The idea is simple: when reading the viminfo file on startup,
> > store the file names from the list of buffer marks in
> > v:oldfiles.  This already makes it possible to use them.  For
> > convenience I added the ":oldfiles"
> > command to list them (nicer than ":echo v:oldfiles").  And
> > the #<N item to be able to use the file name in most places
> > on the command line.
> >
> > Please try the patch and tell me what you think.
>
> Bram - I think there is a glitch in the patch that you attached. It
> looks like a couple of lines are missing -- lines that should say that
> runtime/doc/starting.txt is being patched.
>
> I've just tried building with this patch. I haven't done any testing
> yet, but the patch fails because it is trying to patch eval.txt with
> hunks intended for starting.txt.
>
> I use Yegappan Lakshmanan's wonderful mru.vim for tracking
> recently-used files, but some built-in support would be great.
Sorry for the broken patch.  Here is a new attempt.

-
hundred-and-one symptoms of being an internet addict:
61. Your best friends know your e-mail address, but neither your phone number
    nor the address where you live.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


oldfiles_patch.diff (38K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Patch to try out: v:oldfiles

Charles Campbell
Bram Moolenaar wrote:
Bram Moolenaar wrote:
    
Now and then I start editing a file and want to go back to a 
file I edited in a previous edit session.  But the name 
doesn't appear in the marks or buffer list.  Still, I know 
the file name is in the viminfo file.  There are plugins for 
this, but I thought it would be nice if Vim could retrieve 
file names natively.

The idea is simple: when reading the viminfo file on startup, 
store the file names from the list of buffer marks in 
v:oldfiles.  This already makes it possible to use them.  For 
convenience I added the ":oldfiles"
command to list them (nicer than ":echo v:oldfiles").  And 
the #<N item to be able to use the file name in most places 
on the command line.

Please try the patch and tell me what you think.
      
Bram - I think there is a glitch in the patch that you attached. It
looks like a couple of lines are missing -- lines that should say that
runtime/doc/starting.txt is being patched.

I've just tried building with this patch. I haven't done any testing
yet, but the patch fails because it is trying to patch eval.txt with
hunks intended for starting.txt.

I use Yegappan Lakshmanan's wonderful mru.vim for tracking
recently-used files, but some built-in support would be great.
    

Sorry for the broken patch.  Here is a new attempt.

  

The new patch went in cleanly, but when I tried to do a make:
ex_cmds.c: In function 'do_viminfo':
ex_cmds.c:2094: error: too many arguments to function 'copy_viminfo_marks'
  
I'm using vim7.2.018

Regards,
Chip Campbell


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Patch to try out: v:oldfiles

Charles Campbell

Charles Campbell wrote:

> Bram Moolenaar wrote:
>>> Bram Moolenaar wrote:
>>>    
>>>> Now and then I start editing a file and want to go back to a
>>>> file I edited in a previous edit session.  But the name
>>>> doesn't appear in the marks or buffer list.  Still, I know
>>>> the file name is in the viminfo file.  There are plugins for
>>>> this, but I thought it would be nice if Vim could retrieve
>>>> file names natively.
>>>>
>>>> The idea is simple: when reading the viminfo file on startup,
>>>> store the file names from the list of buffer marks in
>>>> v:oldfiles.  This already makes it possible to use them.  For
>>>> convenience I added the ":oldfiles"
>>>> command to list them (nicer than ":echo v:oldfiles").  And
>>>> the #<N item to be able to use the file name in most places
>>>> on the command line.
>>>>
>>>> Please try the patch and tell me what you think.
>>>>      
>>> Bram - I think there is a glitch in the patch that you attached. It
>>> looks like a couple of lines are missing -- lines that should say that
>>> runtime/doc/starting.txt is being patched.
>>>
>>> I've just tried building with this patch. I haven't done any testing
>>> yet, but the patch fails because it is trying to patch eval.txt with
>>> hunks intended for starting.txt.
>>>
>>> I use Yegappan Lakshmanan's wonderful mru.vim for tracking
>>> recently-used files, but some built-in support would be great.
>>>    
>>
>> Sorry for the broken patch.  Here is a new attempt.
>>
>>  
>
> The new patch went in cleanly, but when I tried to do a make:
>> ex_cmds.c: In function 'do_viminfo':
>> ex_cmds.c:2094: error: too many arguments to function 'copy_viminfo_marks'
>>  
> I'm using vim7.2.018
The problem is that the updated proto/mark.pro was omitted from the
patch; the prototype for copy_viminfo_marks() should be:
  void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count,
int eof, int flags));

(ie. ", int flags" was missing)

Regards,
Chip Campbell


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Patch to try out: v:oldfiles

Bram Moolenaar
> >>>    

> >>>> Now and then I start editing a file and want to go back to a
> >>>> file I edited in a previous edit session.  But the name
> >>>> doesn't appear in the marks or buffer list.  Still, I know
> >>>> the file name is in the viminfo file.  There are plugins for
> >>>> this, but I thought it would be nice if Vim could retrieve
> >>>> file names natively.
> >>>>
> >>>> The idea is simple: when reading the viminfo file on startup,
> >>>> store the file names from the list of buffer marks in
> >>>> v:oldfiles.  This already makes it possible to use them.  For
> >>>> convenience I added the ":oldfiles"
> >>>> command to list them (nicer than ":echo v:oldfiles").  And
> >>>> the #<N item to be able to use the file name in most places
> >>>> on the command line.
> >>>>
> >>>> Please try the patch and tell me what you think.
> >>>>      
> >>> Bram - I think there is a glitch in the patch that you attached. It
> >>> looks like a couple of lines are missing -- lines that should say that
> >>> runtime/doc/starting.txt is being patched.
> >>>
> >>> I've just tried building with this patch. I haven't done any testing
> >>> yet, but the patch fails because it is trying to patch eval.txt with
> >>> hunks intended for starting.txt.
> >>>
> >>> I use Yegappan Lakshmanan's wonderful mru.vim for tracking
> >>> recently-used files, but some built-in support would be great.
> >>>    
> >>
> >> Sorry for the broken patch.  Here is a new attempt.
> >>
> >>  
> >
> > The new patch went in cleanly, but when I tried to do a make:
> >> ex_cmds.c: In function 'do_viminfo':
> >> ex_cmds.c:2094: error: too many arguments to function 'copy_viminfo_marks'
> >>  
> > I'm using vim7.2.018
> The problem is that the updated proto/mark.pro was omitted from the
> patch; the prototype for copy_viminfo_marks() should be:
>   void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count,
> int eof, int flags));
>
> (ie. ", int flags" was missing)
Sorry for another broken patch.  Yet another attempt.  I'll probably do
something different wrong this time...

-
hundred-and-one symptoms of being an internet addict:
69. Yahoo welcomes you with your own start page

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---


oldfiles_patch.diff (43K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Patch to try out: v:oldfiles

Charles-14

On Sep 18, 2:25 am, Bram Moolenaar <[hidden email]> wrote:
> Sorry for another broken patch.  Yet another attempt.  I'll probably do
> something different wrong this time...

Works for me. It seems that not only (old) files are listed there but
also
buffers without real file, for example

~/1221717155_NERD_tree_
.../_TSkeletonScratch_1__
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Patch to try out: v:oldfiles

Bram Moolenaar



> On Sep 18, 2:25 am, Bram Moolenaar <[hidden email]> wrote:
> > Sorry for another broken patch. Yet another attempt. I'll probably do
> > something different wrong this time...
>
> Works for me. It seems that not only (old) files are listed there but
> also buffers without real file, for example
>
> ~/1221717155_NERD_tree_
> .../_TSkeletonScratch_1__

Yes, any buffer with a name and some mark will show up.  It's a bit
difficult to decide what buffers are not useful to store.  Unlisted
buffers are still useful (e.g. for help files you visited).
Perhaps when 'buftype' is "nofile"?

--
hundred-and-one symptoms of being an internet addict:
74. Your most erotic dreams are about cybersex

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---