Skip to content

Commit

Permalink
Provide Airline theme #19
Browse files Browse the repository at this point in the history
  • Loading branch information
morhetz committed Aug 22, 2014
1 parent 4c31ffa commit f90fff7
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 16 deletions.
69 changes: 69 additions & 0 deletions autoload/airline/themes/gruvbox.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
" -----------------------------------------------------------------------------
" File: gruvbox.vim
" Description: Retro groove color scheme for Airline
" Author: morhetz <morhetz@gmail.com>
" Source: https://github.com/morhetz/gruvbox
" Last Modified: 22 Aug 2014
" -----------------------------------------------------------------------------

let g:airline#themes#gruvbox#palette = {}

function! airline#themes#gruvbox#refresh()

let M0 = airline#themes#get_highlight('Identifier')
let accents_group = airline#themes#get_highlight('Special')
let modified_group = [M0[0], '', M0[2], '', '']
let warning_group = airline#themes#get_highlight2(['Normal', 'bg'], ['Question', 'fg'])

let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['StatusLineNC', 'bg'])
let s:N2 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['StatusLineNC', 'fg'])
let s:N3 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['CursorLine', 'bg'])
let g:airline#themes#gruvbox#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#gruvbox#palette.normal_modified = { 'airline_c': modified_group }
let g:airline#themes#gruvbox#palette.normal.airline_warning = warning_group
let g:airline#themes#gruvbox#palette.normal_modified.airline_warning = warning_group

let s:I1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Identifier', 'fg'])
let s:I2 = s:N2
let s:I3 = airline#themes#get_highlight2(['Normal', 'fg'], ['StatusLineNC', 'fg'])
let g:airline#themes#gruvbox#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
let g:airline#themes#gruvbox#palette.insert_modified = g:airline#themes#gruvbox#palette.normal_modified
let g:airline#themes#gruvbox#palette.insert.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning
let g:airline#themes#gruvbox#palette.insert_modified.airline_warning = g:airline#themes#gruvbox#palette.normal_modified.airline_warning

let s:R1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Structure', 'fg'])
let s:R2 = s:I2
let s:R3 = s:I3
let g:airline#themes#gruvbox#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
let g:airline#themes#gruvbox#palette.replace_modified = g:airline#themes#gruvbox#palette.normal_modified
let g:airline#themes#gruvbox#palette.replace.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning
let g:airline#themes#gruvbox#palette.replace_modified.airline_warning = g:airline#themes#gruvbox#palette.normal_modified.airline_warning

let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Question', 'fg'])
let s:V2 = s:N2
let s:V3 = airline#themes#get_highlight2(['Normal', 'bg'], ['TabLine', 'fg'])
let g:airline#themes#gruvbox#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
let g:airline#themes#gruvbox#palette.visual_modified = { 'airline_c': [ s:V3[0], '', s:V3[2], '', '' ] }
let g:airline#themes#gruvbox#palette.visual.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning
let g:airline#themes#gruvbox#palette.visual_modified.airline_warning = g:airline#themes#gruvbox#palette.normal_modified.airline_warning

let s:IA = airline#themes#get_highlight2(['TabLine', 'fg'], ['CursorLine', 'bg'])
let g:airline#themes#gruvbox#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
let g:airline#themes#gruvbox#palette.inactive_modified = { 'airline_c': modified_group }

let g:airline#themes#gruvbox#palette.accents = { 'red': accents_group }

let s:TF = airline#themes#get_highlight2(['Normal', 'bg'], ['Normal', 'bg'])
let g:airline#themes#gruvbox#palette.tabline = {
\ 'airline_tab': s:N2,
\ 'airline_tabsel': s:N1,
\ 'airline_tabtype': s:V1,
\ 'airline_tabfill': s:TF,
\ 'airline_tabhid': s:IA,
\ 'airline_tabmod': s:I1
\ }

endfunction

call airline#themes#gruvbox#refresh()

23 changes: 7 additions & 16 deletions colors/gruvbox.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
" Description: Retro groove color scheme for Vim
" Author: morhetz <morhetz@gmail.com>
" Source: https://github.com/morhetz/gruvbox
" Last Modified: 11 Mar 2014
" Last Modified: 22 Aug 2014
" -----------------------------------------------------------------------------

" Supporting code -------------------------------------------------------------
Expand Down Expand Up @@ -546,7 +546,7 @@ let g:indentLine_color_gui = '#' . s:gb.dark2[0]
" }}}
" Rainbow Parentheses: {{{

let g:rbpt_colorpairs =
let g:rbpt_colorpairs =
\ [
\ ['brown', '#458588'], ['Darkblue', '#b16286'],
\ ['darkgray', '#cc241d'], ['darkgreen', '#d65d0e'],
Expand All @@ -558,15 +558,15 @@ let g:rbpt_colorpairs =
\ ['darkred', '#cc241d'], ['red', '#d65d0e'],
\ ]

let g:rainbow_guifgs =
let g:rainbow_guifgs =
\ [
\ '#458588', '#b16286', '#cc241d', '#d65d0e',
\ '#458588', '#b16286', '#cc241d', '#d65d0e',
\ '#458588', '#b16286', '#cc241d', '#d65d0e',
\ '#458588', '#b16286', '#cc241d', '#d65d0e'
\ ]

let g:rainbow_ctermfgs =
let g:rainbow_ctermfgs =
\ [
\ 'brown', 'Darkblue', 'darkgray', 'darkgreen',
\ 'darkcyan', 'darkred', 'darkmagenta', 'brown',
Expand All @@ -575,15 +575,6 @@ let g:rainbow_ctermfgs =
\ ]

"}}}
" Airline: {{{

if !exists('g:airline_theme_map')
let g:airline_theme_map = { 'gruvbox.*': 'tomorrow' }
else
let g:airline_theme_map['gruvbox.*'] = 'tomorrow'
endif

" }}}
" GitGutter: {{{

if g:gruvbox_invert_signs == 0
Expand Down Expand Up @@ -684,9 +675,9 @@ call s:HL('StartifyFooter', 'dark2')
" Vimshell: {{{

let g:vimshell_escape_colors = map(split(
\ 'dark4 red green yellow blue purple aqua light4 ' .
\ 'dark0 red green orange blue purple aqua light0'
\ ), '"#" . s:gb[v:val][0]')
\ 'dark4 red green yellow blue purple aqua light4 ' .
\ 'dark0 red green orange blue purple aqua light0'
\ ), '"#" . s:gb[v:val][0]')

" }}}

Expand Down

0 comments on commit f90fff7

Please sign in to comment.