From 40ac2b24f172b7abc4e0dc403cb5550872df2227 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 5 Jun 2018 20:40:41 -0600 Subject: [PATCH 1/3] Refactor minimalist.vim, preparing for bg=light support No changes to behavior. This is just refactoring and removing some bits that don't have any effect. --- autoload/airline/themes/minimalist.vim | 100 ++++++++++--------------- 1 file changed, 39 insertions(+), 61 deletions(-) diff --git a/autoload/airline/themes/minimalist.vim b/autoload/airline/themes/minimalist.vim index 5bc7d54..d67434e 100644 --- a/autoload/airline/themes/minimalist.vim +++ b/autoload/airline/themes/minimalist.vim @@ -1,76 +1,54 @@ -" Minimalist Airline - A Material Colorscheme Darker +" Minimalist Airline - A Material Color Scheme Darker " " Author: Diki Ananta " Repository: https://github.com/dikiaap/minimalist -" Version: 1.4 +" Version: 2.0 " License: MIT -" Normal Mode -let s:N1 = [ '#E4E4E4' , '#3A3A3A' , 254 , 237 ] -let s:N2 = [ '#E4E4E4' , '#4E4E4E' , 254 , 239 ] -let s:N3 = [ '#EEEEEE' , '#262626' , 255 , 235 ] +let s:theme = 'minimalist' -" Insert Mode -let s:I1 = [ '#E4E4E4' , '#3A3A3A' , 254 , 237 ] -let s:I2 = [ '#E4E4E4' , '#4E4E4E' , 254 , 239 ] -let s:I3 = [ '#EEEEEE' , '#262626' , 255 , 235 ] +function! airline#themes#{s:theme}#refresh() + " Normal + let N1 = [ '#E4E4E4', '#3A3A3A', 254, 237 ] + let N2 = [ '#E4E4E4', '#4E4E4E', 254, 239 ] + let N3 = [ '#EEEEEE', '#262626', 255, 235 ] -" Visual Mode -let s:V1 = [ '#E4E4E4' , '#3A3A3A' , 254 , 237 ] -let s:V2 = [ '#E4E4E4' , '#4E4E4E' , 254 , 239 ] -let s:V3 = [ '#EEEEEE' , '#262626' , 255 , 235 ] + " Inactive + let IA = [ '#666666', N3[1], 242, N3[3] ] -" Replace Mode -let s:R1 = [ '#E4E4E4' , '#3A3A3A' , 254 , 237 ] -let s:R2 = [ '#E4E4E4' , '#4E4E4E' , 254 , 239 ] -let s:R3 = [ '#EEEEEE' , '#262626' , 255 , 235 ] + " Error + let ER = [ '#1C1C1C', '#D75F5F', 234, 167 ] -" Inactive Mode -let s:IA = [ '#666666' , '#262626' , 242 , 235 , '' ] + " Warning + let WI = [ ER[0], '#FFAF5F', ER[2], 215 ] -let g:airline#themes#minimalist#palette = {} -let g:airline#themes#minimalist#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) -let g:airline#themes#minimalist#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) -let g:airline#themes#minimalist#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) -let g:airline#themes#minimalist#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) -let g:airline#themes#minimalist#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) + " Terminal + let TE = [ ER[0], N1[1], N1[2], N1[3] ] -" Warning Mode -let s:WI = [ '#1C1C1C' , '#FFAF5F' , 234 , 215 , '' ] -let g:airline#themes#minimalist#palette.normal.airline_warning = [ - \ s:WI[0], s:WI[1], s:WI[2], s:WI[3] - \ ] -let g:airline#themes#minimalist#palette.insert.airline_warning = g:airline#themes#minimalist#palette.normal.airline_warning -let g:airline#themes#minimalist#palette.visual.airline_warning = g:airline#themes#minimalist#palette.normal.airline_warning -let g:airline#themes#minimalist#palette.replace.airline_warning = g:airline#themes#minimalist#palette.normal.airline_warning + " Reverse + let NR = [ N2[1], N2[0], N2[3], N2[2], 'bold' ] -" Error Mode -let s:ER = [ '#1C1C1C' , '#D75F5F' , 234 , 167 , '' ] -let g:airline#themes#minimalist#palette.normal.airline_error = [ - \ s:ER[0], s:ER[1], s:ER[2], s:ER[3] - \ ] -let g:airline#themes#minimalist#palette.insert.airline_error = g:airline#themes#minimalist#palette.normal.airline_error -let g:airline#themes#minimalist#palette.visual.airline_error = g:airline#themes#minimalist#palette.normal.airline_error -let g:airline#themes#minimalist#palette.replace.airline_error = g:airline#themes#minimalist#palette.normal.airline_error -" Terminal -let s:TE = [ '#1C1C1C' , '#3A3A3A' , 254 , 237 , '' ] -let g:airline#themes#minimalist#palette.normal.airline_term = [ - \ s:TE[0], s:TE[1], s:TE[2], s:TE[3] - \ ] -let g:airline#themes#minimalist#palette.insert.airline_term = g:airline#themes#minimalist#palette.normal.airline_term -let g:airline#themes#minimalist#palette.visual.airline_term = g:airline#themes#minimalist#palette.normal.airline_term -let g:airline#themes#minimalist#palette.replace.airline_term = g:airline#themes#minimalist#palette.normal.airline_term + let palette = {} -" Accents -let g:airline#themes#minimalist#palette.accents = { - \ 'red': [ '#D75F5F' , '' , 167 , '' ] - \ } + let palette.normal = airline#themes#generate_color_map(N1, N2, N3) + let palette.normal.airline_error = ER + let palette.normal.airline_warning = WI + let palette.normal.airline_term = TE -" CtrlP -if get(g:, 'loaded_ctrlp', 0) - let g:airline#themes#minimalist#palette.ctrlp = airline#extensions#ctrlp#generate_color_map( - \ [ '#E4E4E4' , '#262626' , 254 , 235 , '' ], - \ [ '#E4E4E4' , '#4E4E4E' , 254 , 239 , '' ], - \ [ '#585858' , '#E4E4E4' , 240 , 254 , 'bold' ]) -endif + let palette.inactive = airline#themes#generate_color_map(IA, IA, IA) + + " Accents + let palette.accents = { + \ 'red': [ ER[1], '', ER[3], '' ] + \ } + + " CtrlP + if get(g:, 'loaded_ctrlp', 0) + let palette.ctrlp = airline#extensions#ctrlp#generate_color_map(N3, N2, NR) + endif + + let g:airline#themes#{s:theme}#palette = palette +endfunction + +call airline#themes#{s:theme}#refresh() From 8bf9615d131a11cb526f64b3479270ed2d290f5c Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 5 Jun 2018 20:51:12 -0600 Subject: [PATCH 2/3] Support light background in minimalist theme --- autoload/airline/themes/minimalist.vim | 38 ++++++++++++++++++-------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/autoload/airline/themes/minimalist.vim b/autoload/airline/themes/minimalist.vim index d67434e..6eeb276 100644 --- a/autoload/airline/themes/minimalist.vim +++ b/autoload/airline/themes/minimalist.vim @@ -1,4 +1,4 @@ -" Minimalist Airline - A Material Color Scheme Darker +" Minimalist Airline - A Material Color Scheme " " Author: Diki Ananta " Repository: https://github.com/dikiaap/minimalist @@ -8,19 +8,35 @@ let s:theme = 'minimalist' function! airline#themes#{s:theme}#refresh() - " Normal - let N1 = [ '#E4E4E4', '#3A3A3A', 254, 237 ] - let N2 = [ '#E4E4E4', '#4E4E4E', 254, 239 ] - let N3 = [ '#EEEEEE', '#262626', 255, 235 ] + if &background == "dark" + " Normal + let N1 = [ '#E4E4E4', '#3A3A3A', 254, 237 ] + let N2 = [ '#E4E4E4', '#4E4E4E', 254, 239 ] + let N3 = [ '#EEEEEE', '#262626', 255, 235 ] - " Inactive - let IA = [ '#666666', N3[1], 242, N3[3] ] + " Inactive + let IA = [ '#666666', N3[1], 242, N3[3] ] - " Error - let ER = [ '#1C1C1C', '#D75F5F', 234, 167 ] + " Error + let ER = [ '#1C1C1C', '#D75F5F', 234, 167 ] - " Warning - let WI = [ ER[0], '#FFAF5F', ER[2], 215 ] + " Warning + let WI = [ ER[0], '#FFAF5F', ER[2], 215 ] + else + " Normal + let N1 = [ 'gray30', 'gray70', 235, 249 ] + let N2 = [ 'gray20', 'gray60', 233, 246 ] + let N3 = [ 'gray20', 'gray80', 233, 251 ] + + " Inactive + let IA = [ 'gray15', N3[1], 244, N3[3] ] + + " Error + let ER = [ '#1C1C1C', '#D75F5F', 234, 167 ] + + " Warning + let WI = [ ER[0], '#FFAF5F', ER[2], 215 ] + endif " Terminal let TE = [ ER[0], N1[1], N1[2], N1[3] ] From c00362b2b0f031f5e8ccda4ef73b43db0b173134 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 5 Jun 2018 21:06:23 -0600 Subject: [PATCH 3/3] Add normal_modified highlighting to minimalist theme --- autoload/airline/themes/minimalist.vim | 8 ++++++++ doc/airline-themes.txt | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/autoload/airline/themes/minimalist.vim b/autoload/airline/themes/minimalist.vim index 6eeb276..61bad1e 100644 --- a/autoload/airline/themes/minimalist.vim +++ b/autoload/airline/themes/minimalist.vim @@ -7,6 +7,10 @@ let s:theme = 'minimalist' +" To highlight when the buffer is modified: +" let g:airline_minimalist_showmod = 1 +let s:want_showmod = get(g:, 'airline_minimalist_showmod', 0) + function! airline#themes#{s:theme}#refresh() if &background == "dark" " Normal @@ -54,6 +58,10 @@ function! airline#themes#{s:theme}#refresh() let palette.inactive = airline#themes#generate_color_map(IA, IA, IA) + if s:want_showmod + let palette.normal_modified = { 'airline_a': NR, 'airline_z': NR } + endif + " Accents let palette.accents = { \ 'red': [ ER[1], '', ER[3], '' ] diff --git a/doc/airline-themes.txt b/doc/airline-themes.txt index 7dac95f..6aba1e7 100644 --- a/doc/airline-themes.txt +++ b/doc/airline-themes.txt @@ -99,7 +99,7 @@ Currently this repository contains the following themes: * light * lucius * luna - * minimalist + * minimalist (|airline-theme-minimalist|) * molokai * monochrome * murmur @@ -196,6 +196,13 @@ setup once. However, it won't change colors if e.g. the mode changes. Set to 256 for 256-color mode (the default), or 16 for 16-color mode. Has no effect if using true/24-bit color. To enable 16-color mode: > let g:deus_termcolors = 16 + +*airline-theme-minimalist* +------------------------------------------------------------------------------ + *g:airline_minimalist_showmod* + +Highlight when the buffer is modified. + let g:airline_minimalist_showmod = 1 < *airline-theme-onedark* ------------------------------------------------------------------------------