Closed mroavi closed 2 years ago
Here is an initial idea. This is still missing the check of whether the option is set:
" plugin/mru.vim
...
" Load the MRU list on plugin startup
call s:MRU_LoadList()
" Set the first entry in MRU list as alternate file
let s:MRU_file = s:MRU_files[0]
call bufadd(s:MRU_file)
let @# = s:MRU_file
...
This implementation does not add the buffer to the buffer list. We would need to decide whether we would like that to happen or not.
This is a good idea. I will make this a configurable option (default is disabled). I will push a change for this.
This is addressed by f30ba874a996fdcb5e4ec6060d7cefe6ff247055.
I noticed that the new patch does not work with nvim because of this check:
&& (v:version >= 802 || has('patch-8.1.1610'))
It does work fine if removed. Could you adapt it to support nvim as well?
I have pushed a commit to check for nvim also. Can you try that out?
Works great now. Thanks.
My feature request is to add an option that enables setting vim's alternate file to the first entry in the MRU list at startup. I don't understand why vim doesn't provide an option to remember the alternate file. Not even using Sessions. Let me know what you think.