From 3e61fb902abed6733e936ba0193269860699413d Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Tue, 13 Dec 2022 12:54:26 +0100 Subject: [PATCH] vim: initialize colorizer only if termguicolors is set This additional check is needed because when nvim is started as `nvim -u NORC`, my configuration that sets `termguicolors` is not called but colorizer IS installed and requires `termguicolors` to be set. If it is not set, the setup() function prints an error. --- config/nvim/after/plugin/colorizer.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/nvim/after/plugin/colorizer.lua b/config/nvim/after/plugin/colorizer.lua index 8468949..77a6a94 100644 --- a/config/nvim/after/plugin/colorizer.lua +++ b/config/nvim/after/plugin/colorizer.lua @@ -1,5 +1,5 @@ local ok, colorizer = pcall(require, 'colorizer') -if ok and colorizer then +if ok and colorizer and vim.opt.termguicolors:get() then colorizer.setup({'*'}, { mode = 'foreground' }) end