.vimrc: Use g:solarized_termcolors=256 if supported
authorTony Duckles <tony@nynim.org>
Sat, 23 Dec 2017 04:23:19 +0000
committerTony Duckles <tony@nynim.org>
Sat, 23 Dec 2017 04:29:42 +0000
.vimrc

diff --git a/.vimrc b/.vimrc
index d0c5145a48eb5be1834227319d9a258c479bb01d..9ed9ed14e762bf03dc731e761b374d1f76e4ce15 100644 (file)
--- a/.vimrc
+++ b/.vimrc
@@ -76,6 +76,9 @@ if &t_Co > 2 || has("gui_running")
   syntax enable                       " syntax highligting
 
   let g:solarized_termtrans=1         " always use terminal's default bg color
+  if &t_Co == 256
+    let g:solarized_termcolors=256    " use 256 colors for solarized
+  endif
   colorscheme solarized
   let g:airline_theme='solarized16'   " vim-airline theme
   let g:solarized16_termcolors=16     " always use 16 colors for 'solarized16' vim-airline theme