I do a lot of editing in vim and am constantly opening up files using
:new ...etc. However, when I quit vim, I do not have the files I edited in my
.bash_history. Since I keep finding myself needing this, I thought I'd add an
au recipe like:
autocmd BufNewFile,BufRead * \ [ check if %:p is same as new file being opened ...is that <afile>?? ] | \ !history -s vim <...>
I was wondering whether there are any downsides to this ? and secondly, if not, what's the exact idiomatic vimscript way to express this ?
Edit: After a bit of reading, I discovered the
browse oldfiles commands, so as an alternative way to solve my request -- what would be the set of vimscript spells to invoke that will tell vim -- open up the
oldfiles in a buffer if no arguments were provided on the commandline (as opposed to an empty
:new) ? Essentially, override the vim welcome buffer (which has the centered text of version, help etc), with
...or ...add the files edited in current session to bash_history on exit ...or a different way to achieve the same effect ?