init: Reduced gruvbox caps on linux console
authorStefan Huber <shuber@sthu.org>
Sat, 30 Jan 2021 13:01:37 +0000 (14:01 +0100)
committerStefan Huber <shuber@sthu.org>
Sat, 30 Jan 2021 13:04:17 +0000 (14:04 +0100)
Set g:gruvbox_termcolors to 16 on linux console and activate advanced
capabilities, like italics, only in the other case.

init.vim

index 9817a3d79d61357cfc2d59a30af46c7bc6981c29..c97a142a3345e793f5af5076ecad34093edecd79 100644 (file)
--- a/init.vim
+++ b/init.vim
@@ -6,9 +6,6 @@
 " Some global settings
 
 set nocompatible
-" Breaks colors for some versions of mosh, but not if tmux is used on top of
-" mosh. See https://github.com/mobile-shell/mosh/issues/928
-set termguicolors
 set number
 set cursorline
 set scrolloff=5
@@ -94,8 +91,18 @@ let g:airline#extensions#branch#enabled=1
 
 let g:gruvbox_contrast_light='hard'
 let g:gruvbox_contrast_dark='hard'
-let g:gruvbox_italic = 1
 set bg=dark
+
+if &term =~ 'linux'
+    let g:gruvbox_termcolors=16
+else
+    " Setting termguicolors has two implications:
+    " - Breaks colors for some versions of mosh, but not if tmux is used on top of
+    "   mosh. See https://github.com/mobile-shell/mosh/issues/928
+    " - Breaks some colors in :terminal, e.g., when launching gdb in vim.
+    set termguicolors
+    let g:gruvbox_italic = 1
+endif
 colorscheme gruvbox
 
 " let NERDTreeWinPos="right"