diff --git a/Readme.md b/Readme.md index 6c6002a..10bd0bf 100644 --- a/Readme.md +++ b/Readme.md @@ -62,10 +62,12 @@ The following options are inherited from Solarized: - `g:solarized_visibility`: one of `"normal"` (default), `"low"`, `"high"`; - `g:solarized_diffmode`: one of `"normal"` (default), `"low"`, `"high"`; +- `g:solarized_termtrans`: make terminal background transparent if set to `1` + (default: `0`). The following options were not available in the original Solarized: -- `g:solarized_statusline`: one of `"normal"` (default) or `"low"`. +- `g:solarized_statusline`: one of `"normal"` (default) or `"low"`; - `g:solarized_term_italics`: set to `1` if your terminal supports italics (default is `0`). diff --git a/colors/solarized8_dark.vim b/colors/solarized8_dark.vim index 49a5efe..12d2581 100644 --- a/colors/solarized8_dark.vim +++ b/colors/solarized8_dark.vim @@ -10,7 +10,11 @@ endif let colors_name = "solarized8_dark" set background=dark -hi! Normal cterm=NONE gui=NONE ctermfg=12 guifg=#839496 ctermbg=8 guibg=#002b36 +if !has('gui_running') && get(g:, 'solarized_termtrans', 0) + hi! Normal cterm=NONE gui=NONE ctermfg=12 guifg=#839496 ctermbg=NONE guibg=NONE +else + hi! Normal cterm=NONE gui=NONE ctermfg=12 guifg=#839496 ctermbg=8 guibg=#002b36 +endif hi! Comment cterm=NONE gui=NONE,italic ctermfg=10 guifg=#586e75 ctermbg=NONE guibg=NONE hi! Constant cterm=NONE gui=NONE ctermfg=6 guifg=#2aa198 ctermbg=NONE guibg=NONE hi! Identifier cterm=NONE gui=NONE ctermfg=4 guifg=#268bd2 ctermbg=NONE guibg=NONE diff --git a/colors/solarized8_dark_flat.vim b/colors/solarized8_dark_flat.vim index d22a610..8b3c30c 100644 --- a/colors/solarized8_dark_flat.vim +++ b/colors/solarized8_dark_flat.vim @@ -10,7 +10,11 @@ endif let colors_name = "solarized8_dark_flat" set background=dark -hi! Normal cterm=NONE gui=NONE ctermfg=12 guifg=#839496 ctermbg=8 guibg=#002b36 +if !has('gui_running') && get(g:, 'solarized_termtrans', 0) + hi! Normal cterm=NONE gui=NONE ctermfg=12 guifg=#839496 ctermbg=NONE guibg=NONE +else + hi! Normal cterm=NONE gui=NONE ctermfg=12 guifg=#839496 ctermbg=8 guibg=#002b36 +endif hi! Comment cterm=NONE gui=NONE,italic ctermfg=10 guifg=#586e75 ctermbg=NONE guibg=NONE hi! Constant cterm=NONE gui=NONE ctermfg=6 guifg=#2aa198 ctermbg=NONE guibg=NONE hi! Identifier cterm=NONE gui=NONE ctermfg=4 guifg=#268bd2 ctermbg=NONE guibg=NONE diff --git a/colors/solarized8_dark_high.vim b/colors/solarized8_dark_high.vim index 8c0323d..1ff08e3 100644 --- a/colors/solarized8_dark_high.vim +++ b/colors/solarized8_dark_high.vim @@ -10,7 +10,11 @@ endif let colors_name = "solarized8_dark_high" set background=dark -hi! Normal cterm=NONE gui=NONE ctermfg=14 guifg=#93a1a1 ctermbg=8 guibg=#002b36 +if !has('gui_running') && get(g:, 'solarized_termtrans', 0) + hi! Normal cterm=NONE gui=NONE ctermfg=14 guifg=#93a1a1 ctermbg=NONE guibg=NONE +else + hi! Normal cterm=NONE gui=NONE ctermfg=14 guifg=#93a1a1 ctermbg=8 guibg=#002b36 +endif hi! Comment cterm=NONE gui=NONE,italic ctermfg=11 guifg=#657b83 ctermbg=NONE guibg=NONE hi! Constant cterm=NONE gui=NONE ctermfg=6 guifg=#2aa198 ctermbg=NONE guibg=NONE hi! Identifier cterm=NONE gui=NONE ctermfg=4 guifg=#268bd2 ctermbg=NONE guibg=NONE diff --git a/colors/solarized8_dark_low.vim b/colors/solarized8_dark_low.vim index 54ed7cf..944ade2 100644 --- a/colors/solarized8_dark_low.vim +++ b/colors/solarized8_dark_low.vim @@ -10,7 +10,11 @@ endif let colors_name = "solarized8_dark_low" set background=dark -hi! Normal cterm=NONE gui=NONE ctermfg=12 guifg=#839496 ctermbg=0 guibg=#073642 +if !has('gui_running') && get(g:, 'solarized_termtrans', 0) + hi! Normal cterm=NONE gui=NONE ctermfg=12 guifg=#839496 ctermbg=NONE guibg=NONE +else + hi! Normal cterm=NONE gui=NONE ctermfg=12 guifg=#839496 ctermbg=0 guibg=#073642 +endif hi! Comment cterm=NONE gui=NONE,italic ctermfg=10 guifg=#586e75 ctermbg=NONE guibg=NONE hi! Constant cterm=NONE gui=NONE ctermfg=6 guifg=#2aa198 ctermbg=NONE guibg=NONE hi! Identifier cterm=NONE gui=NONE ctermfg=4 guifg=#268bd2 ctermbg=NONE guibg=NONE diff --git a/colors/solarized8_light.vim b/colors/solarized8_light.vim index cd72b74..10cab97 100644 --- a/colors/solarized8_light.vim +++ b/colors/solarized8_light.vim @@ -10,7 +10,11 @@ endif let colors_name = "solarized8_light" set background=light -hi! Normal cterm=NONE gui=NONE ctermfg=11 guifg=#657b83 ctermbg=15 guibg=#fdf6e3 +if !has('gui_running') && get(g:, 'solarized_termtrans', 0) + hi! Normal cterm=NONE gui=NONE ctermfg=11 guifg=#657b83 ctermbg=NONE guibg=NONE +else + hi! Normal cterm=NONE gui=NONE ctermfg=11 guifg=#657b83 ctermbg=15 guibg=#fdf6e3 +endif hi! Comment cterm=NONE gui=NONE,italic ctermfg=14 guifg=#93a1a1 ctermbg=NONE guibg=NONE hi! Constant cterm=NONE gui=NONE ctermfg=6 guifg=#2aa198 ctermbg=NONE guibg=NONE hi! Identifier cterm=NONE gui=NONE ctermfg=4 guifg=#268bd2 ctermbg=NONE guibg=NONE diff --git a/colors/solarized8_light_flat.vim b/colors/solarized8_light_flat.vim index d5a9b17..9f026bd 100644 --- a/colors/solarized8_light_flat.vim +++ b/colors/solarized8_light_flat.vim @@ -10,7 +10,11 @@ endif let colors_name = "solarized8_light_flat" set background=light -hi! Normal cterm=NONE gui=NONE ctermfg=11 guifg=#657b83 ctermbg=15 guibg=#fdf6e3 +if !has('gui_running') && get(g:, 'solarized_termtrans', 0) + hi! Normal cterm=NONE gui=NONE ctermfg=11 guifg=#657b83 ctermbg=NONE guibg=NONE +else + hi! Normal cterm=NONE gui=NONE ctermfg=11 guifg=#657b83 ctermbg=15 guibg=#fdf6e3 +endif hi! Comment cterm=NONE gui=NONE,italic ctermfg=14 guifg=#93a1a1 ctermbg=NONE guibg=NONE hi! Constant cterm=NONE gui=NONE ctermfg=6 guifg=#2aa198 ctermbg=NONE guibg=NONE hi! Identifier cterm=NONE gui=NONE ctermfg=4 guifg=#268bd2 ctermbg=NONE guibg=NONE diff --git a/colors/solarized8_light_high.vim b/colors/solarized8_light_high.vim index 7d8719c..5f8d904 100644 --- a/colors/solarized8_light_high.vim +++ b/colors/solarized8_light_high.vim @@ -10,7 +10,11 @@ endif let colors_name = "solarized8_light_high" set background=light -hi! Normal cterm=NONE gui=NONE ctermfg=10 guifg=#586e75 ctermbg=15 guibg=#fdf6e3 +if !has('gui_running') && get(g:, 'solarized_termtrans', 0) + hi! Normal cterm=NONE gui=NONE ctermfg=10 guifg=#586e75 ctermbg=NONE guibg=NONE +else + hi! Normal cterm=NONE gui=NONE ctermfg=10 guifg=#586e75 ctermbg=15 guibg=#fdf6e3 +endif hi! Comment cterm=NONE gui=NONE,italic ctermfg=12 guifg=#839496 ctermbg=NONE guibg=NONE hi! Constant cterm=NONE gui=NONE ctermfg=6 guifg=#2aa198 ctermbg=NONE guibg=NONE hi! Identifier cterm=NONE gui=NONE ctermfg=4 guifg=#268bd2 ctermbg=NONE guibg=NONE diff --git a/colors/solarized8_light_low.vim b/colors/solarized8_light_low.vim index 02eb55a..535bb0c 100644 --- a/colors/solarized8_light_low.vim +++ b/colors/solarized8_light_low.vim @@ -10,7 +10,11 @@ endif let colors_name = "solarized8_light_low" set background=light -hi! Normal cterm=NONE gui=NONE ctermfg=11 guifg=#657b83 ctermbg=7 guibg=#eee8d5 +if !has('gui_running') && get(g:, 'solarized_termtrans', 0) + hi! Normal cterm=NONE gui=NONE ctermfg=11 guifg=#657b83 ctermbg=NONE guibg=NONE +else + hi! Normal cterm=NONE gui=NONE ctermfg=11 guifg=#657b83 ctermbg=7 guibg=#eee8d5 +endif hi! Comment cterm=NONE gui=NONE,italic ctermfg=14 guifg=#93a1a1 ctermbg=NONE guibg=NONE hi! Constant cterm=NONE gui=NONE ctermfg=6 guifg=#2aa198 ctermbg=NONE guibg=NONE hi! Identifier cterm=NONE gui=NONE ctermfg=4 guifg=#268bd2 ctermbg=NONE guibg=NONE diff --git a/src/solarized8.vim b/src/solarized8.vim index 70bab2e..56e4834 100644 --- a/src/solarized8.vim +++ b/src/solarized8.vim @@ -155,7 +155,11 @@ for s:solarized_background in ["dark", "light"] "}}} - call s:put("hi! Normal" .s:fmt_none .s:fg_base0 .s:bg_back) + call s:put("if !has('gui_running') && get(g:, 'solarized_termtrans', 0)") + call s:put(" hi! Normal" .s:fmt_none .s:fg_base0 .s:bg_none) + call s:put("else") + call s:put(" hi! Normal" .s:fmt_none .s:fg_base0 .s:bg_back) + call s:put("endif") " Basic highlighting"{{{ " ---------------------------------------------------------------------