I simply want to emulate the effect of -p
by default i.e. open all files in tabs when multiple files are supplied. I wrote the following autocommand to make it work.
-- Open files in tabs by default
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
if not vim.opt.diff:get() and #vim.fn.argv() > 1 then
vim.cmd("tab sball")
vim.cmd("tabfirst")
end
end,
})
But it seems to bork the colorscheme for all but the first tab. It’s weird since Running the same commands manually after neovim
is loaded works perfectly. I may have something to do with the order in which things are run. Is it possible to run this command as late as possible?
I’m open to alternative approaches that gets the job done.
You must log in or register to comment.