I'm using a plugin called startscreen to customize my start screen. The problem is that whenever I enter vim the startscreen will be added to the oldfiles list. How can I avoid this. Is there any command to remove the current buffer or a certain buffer from the oldfiles?
For the startscreen buffer: echo &buftype
gives nofile
EDIT:
It appears that the vim's oldfiles
is different with the telescope plugin. As B Layer mentioned in the comments, telescope adds some buffers (whether from :buffer
or the current buffer) to its oldfile
built-in function.
I managed to fix this by defining a custom oldfile
function, named old_files
, which passes certain arguments to the built-in oldfile
function.
local M = {}
function M.old_files()
local fileopts = {}
fileopts.file_ignore_patterns = {
"splash.txt",
}
require("telescope.builtin").oldfiles(fileopts)
end
As argument, I simply told telescope to ignore a file name pattern when listing the oldfiles
by passing fileopt
object as argument to built-in oldfiles
. From there, I can use this function in a binding.
neovim 0.5 -- linux