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 <noreply@anthropic.com>
This commit is contained in:
thomas.kopp
2026-08-08 22:45:53 +02:00
co-authored by Claude Opus 5
parent 6999f19b0a
commit 3d1a8da9ef
+6 -1
View File
@@ -145,7 +145,12 @@ let mapleader="\<SPACE>"
" UI Options { " UI Options {
" Colorscheme options. " Colorscheme options.
set bg=dark 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. " Also highlight all tabs and trailing whitespace characters.
highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen