this post was submitted on 26 Jun 2025
5 points (100.0% liked)

Neovim

2508 readers
1 users here now

founded 2 years ago
MODERATORS
 

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.

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here