yegappan / mru

Most Recently Used (MRU) Vim Plugin
Other
259 stars 48 forks source link

Update the mru file using the BufEnter autocmd #36

Closed mroavi closed 3 years ago

mroavi commented 3 years ago

I personally find that updating the mru list based on the BufEnter event provides a much better user experience. I would like to know your thoughts on this.

yegappan commented 3 years ago

Using only the BufEnter autocmd will not handle some of the cases. For example, consider the following set of commands:

enew
<insert some contents>
w newfile.txt
quit

In the above case, using only the BufEnter autocmd, the file newfile.txt will not be added to the MRU list. Same applies to the following scenario:

enew
r someexistingfile.txt
w newfile.txt
quit
mroavi commented 3 years ago

Hmm I see. Yeah you are right.. they are important indeed.

And what about adding the BufEnter command to the existing ones? The reason I propose this is because a very common scenario is to open a file to quickly consult something and then close it. With the current setup, this file doesn't get added to the MRU file list. And it turns out that the likelihood of needing that file again is super high.

yegappan commented 3 years ago

Do you have an example (series of of commands) that shows a file not getting added to the MRU list?

mroavi commented 3 years ago

Ohh wait. What I said above is not correct. What I meant is that the order of the list does not get updated when you open a file that is already in your buffer list. I personally find it convenient if this order is always up to date with the order in which you viewed the files.