From 3d1a8da9ef5b738b07acfb9aa20781c030bb5e98 Mon Sep 17 00:00:00 2001 From: "thomas.kopp" Date: Sat, 8 Aug 2026 22:45:53 +0200 Subject: [PATCH] fix(nvim): make the colorscheme optional Every nvim start on shron printed E185: Cannot find color scheme 'gruvbox' because gruvbox is a vim-plug plugin and :PlugInstall has never run there - the plugged directory does not exist at all. The config is checked out on all three machines, so it cannot assume the plugins are present. silent! is the idiomatic answer: the theme loads where it exists and is skipped where it does not. The airline settings below need no such treatment; they are plain variable assignments and are simply ignored when the plugin is absent. Co-Authored-By: Claude Opus 5 --- .config/nvim/init.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index cee4a3f..6782660 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -145,7 +145,12 @@ let mapleader="\" " UI Options { " Colorscheme options. set bg=dark - colorscheme gruvbox + " silent!, because the colorscheme comes from a vim-plug plugin and this + " file is checked out on machines where :PlugInstall has never run. Without + " it every nvim start on shron printed + " E185: Cannot find color scheme 'gruvbox' + " A missing theme is not worth an error; the default one works. + silent! colorscheme gruvbox " Also highlight all tabs and trailing whitespace characters. highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen