diff --git a/configs/init.lua b/configs/init.lua index a079c69..5df688d 100644 --- a/configs/init.lua +++ b/configs/init.lua @@ -1,11 +1,10 @@ +local u = require("utils") + local o = vim.o local opt = vim.opt local g = vim.g local cmd = vim.cmd; -cmd [[highlight Normal guibg=none]] -cmd [[highlight NonText guibg=none]] - require("install-paq") local paq = require("paq"); @@ -37,9 +36,6 @@ if not(status) then paq.install(); end -local u = require("utils") - - -- Global options o.number = true o.tabstop = 2 @@ -58,8 +54,9 @@ g.NERDTreeMinimalUI = true g.NERDTreeDirArrows = true g.hidden = true g.material_theme_style = "ocean_community" - -cmd [[colorscheme material]] +if u.has_plugin("material") then +c md [[colorscheme material]] +end -- Remove background color cmd [[highlight Normal guibg=none]] cmd [[highlight NonText guibg=none]] diff --git a/configs/lua/utils.lua b/configs/lua/utils.lua index 66f3651..70466c0 100644 --- a/configs/lua/utils.lua +++ b/configs/lua/utils.lua @@ -24,8 +24,8 @@ local function dump(o) end function M.has_plugin(pluginName) - local rtp = vim.api.nvim_eval('&rtp') - return rtp:match(pluginName) + local status = pcall(require, pluginName); + return status end return M