Squashed commit of the following:

commit 7cd477ba7fb2f960c9e832626546e12ab939b59e
Merge: b6e3d5c 9f93628
Author: Bailey Ling <bling@live.ca>
Date:   Mon Jul 15 20:07:01 2013 +0000

    Merge branch 'solarized-themes-merge' of https://github.com/seletskiy/vim-airline into seletskiy-solarized-themes-merge

commit 9f936281ed
Author: Stanislav Seletskiy <s.seletskiy@office.ngs.ru>
Date:   Mon Jul 15 11:57:14 2013 +0700

    get rid of background detection magic

commit 230b16d3c5
Author: Stanislav Seletskiy <s.seletskiy@office.ngs.ru>
Date:   Sun Jul 14 12:22:30 2013 +0700

    merge solarized and solarized2

    g:airline_solarized_reduced controls how many colors can change between
    mode switching.
This commit is contained in:
Bailey Ling
2013-07-15 20:09:52 +00:00
parent b6e3d5cd19
commit a6895e2754
2 changed files with 57 additions and 148 deletions
+57 -21
View File
@@ -1,3 +1,9 @@
""""""""""""""""""""""""""""""""""""""""""""""""
" Options
""""""""""""""""""""""""""""""""""""""""""""""""
let s:reduced = get(g:, 'airline_solarized_reduced', 1)
let s:background = get(g:, 'airline_solarized_bg', &background)
""""""""""""""""""""""""""""""""""""""""""""""""
" Colors
""""""""""""""""""""""""""""""""""""""""""""""""
@@ -18,13 +24,8 @@ let s:violet = {'t': 61, 'g': '#6c71c4'}
let s:blue = {'t': 33, 'g': '#267bd2'}
let s:cyan = {'t': 37, 'g': '#2aa198'}
let s:green = {'t': 64, 'g': '#859900'}
" Get background color
if index([string(s:base03.t), s:base03.g], synIDattr(synIDtrans(hlID('Normal')), 'bg')) > -1
let s:background = 'dark'
else
let s:background = 'light'
end
let s:c218 = {'t': 218, 'g': '#ffafd7'}
let s:c52 = {'t': 52, 'g': '#5f0000'}
""""""""""""""""""""""""""""""""""""""""""""""""
" Simple mappings
@@ -40,31 +41,66 @@ else
let s:N3 = [s:base00, s:base2, '']
endif
let s:NF = [s:orange, s:N3[1], '']
if s:background == 'dark'
let s:NM = {
\ 'info_separator': [s:N2[1], s:N3[1], ''],
\ 'statusline': [s:magenta, s:N3[1], ''],
\ }
if s:reduced
if s:background == 'dark'
let s:NM = {
\ 'info_separator': [s:N2[1], s:N3[1], ''],
\ 'statusline': [s:magenta, s:N3[1], ''],
\ }
else
let s:NM = {
\ 'info_separator': [s:N2[1], s:N3[1], ''],
\ 'statusline': [s:magenta, s:N3[1], ''],
\ }
endif
else
let s:NM = {
\ 'info_separator': [s:N2[1], s:N3[1], ''],
\ 'statusline': [s:magenta, s:N3[1], ''],
\ }
if s:background == 'dark'
let s:NM = {
\ 'info_separator': [s:N2[1], s:c52, ''],
\ 'statusline': [s:c218, s:c52, '']
\ }
else
let s:NM = {
\ 'info_separator': [s:N2[1], s:c218, ''],
\ 'statusline': [s:red, s:c218, '']
\ }
endif
endif
" Insert mode
let s:I1 = [s:N1[0], s:green, 'bold']
let s:I2 = s:N2
if s:reduced
let s:I2 = s:N2
else
let s:I2 = [s:base3, s:base1, '']
endif
let s:I3 = s:N3
let s:IF = s:NF
let s:IM = s:NM
if s:reduced
let s:IM = s:NM
else
let s:IM = {
\ 'info_separator': [s:I2[1], s:NM.statusline[1], ''],
\ 'statusline': s:NM.statusline
\ }
endif
" Visual mode
let s:V1 = [s:N1[0], s:orange, 'bold']
let s:V2 = s:N2
let s:V3 = s:N3
if s:reduced
let s:V2 = s:N2
let s:V3 = s:N3
else
let s:V2 = s:I2
let s:V3 = s:I3
endif
let s:VF = s:NF
let s:VM = s:NM
if s:reduced
let s:VM = s:NM
else
let s:VM = s:IM
endif
" Inactive
if s:background == 'dark'