From 5fc61260b001394340671c05cc143de675d794e7 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Wed, 12 Jan 2022 23:19:36 -0600 Subject: [PATCH] Better handling for missing colorscheme --- .config/nvim/lua/core/theme.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/core/theme.lua b/.config/nvim/lua/core/theme.lua index 292757e1..388d0775 100755 --- a/.config/nvim/lua/core/theme.lua +++ b/.config/nvim/lua/core/theme.lua @@ -5,7 +5,12 @@ vim.g.tokyonight_style = "night" vim.g.tokyonight_transparent = true vim.g.tokyonight_transparent_sidebar = true -vim.cmd("colorscheme tokyonight") +local loaded, _ = pcall(vim.cmd, "colorscheme tokyonight") + +if not loaded then + error("Colorscheme could not be loaded likely due to a packerstrap install, restart neovim once packer is done...") +end + end return M