feat: detect headless and set interactive=false

This commit is contained in:
Folke Lemaitre 2022-11-25 22:49:41 +01:00
parent 80a2b71a09
commit bad1b1f87d
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 4 additions and 1 deletions

View File

@ -51,7 +51,10 @@ function M.setup(opts)
M.paths.plugins = vim.fn.stdpath("config") .. "/lua/" .. M.options.plugins:gsub("%.", "/")
M.paths.main = M.paths.plugins .. (vim.loop.fs_stat(M.paths.plugins .. ".lua") and ".lua" or "/init.lua")
-- vim.fn.mkdir(M.options.package_path, "p")
-- TODO: check what this does inside a GUI. Probably still ok
if #vim.api.nvim_list_uis() == 0 then
M.options.interactive = false
end
vim.api.nvim_create_autocmd("User", {
pattern = "VeryLazy",