diff --git a/README.md b/README.md index 84450e1..76404f0 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,6 @@ A dark Vim color scheme for the GUI and 16/256-color terminals, based on [FlatCo ![onedark.vim Preview](https://raw.githubusercontent.com/joshdick/onedark.vim/master/preview.png) -Preview image taken using: - -* [iTerm2](https://iterm2.com) terminal emulator on Mac OS X -* 12 pt. [PragmataPro Mono](http://www.fsd.it/fonts/pragmatapro.htm#.VlDa1q6rTOY) font -* [airline-onedark.vim](https://github.com/joshdick/airline-onedark.vim) theme for [vim-airline](https://github.com/bling/vim-airline) -* [vim-polyglot](https://github.com/sheerun/vim-polyglot) plug-in - ## Installation 1. If you use Vim in the terminal, determine whether [your terminal emulator has 24-bit color ("true color") support](https://gist.github.com/XVilka/8346728). @@ -78,5 +71,30 @@ Preview image taken using: ## vim-airline Theme -A companion [vim-airline](https://github.com/bling/vim-airline) theme for this color scheme is available at [joshdick/airline-onedark.vim](https://github.com/joshdick/airline-onedark.vim). +![airline-onedark.vim Preview](https://raw.github.com/joshdick/onedark.vim/master/preview_airline.png) +This repository includes a companion [vim-airline](https://github.com/bling/vim-airline) theme for use with onedark.vim. + +The vim-airline theme: + +* Depends on onedark.vim for its colors, and must therefore be used in conjunction with it. +* Works with both color modes available in onedark.vim (16 or 256 colors), as specified in the configuration for onedark.vim. +* Is based on vim-airline's ["tomorrow" theme](https://github.com/bling/vim-airline/blob/master/autoload/airline/themes/tomorrow.vim). + +### Installation + +(These instructions assume that vim-airline and onedark.vim are already installed and configured to your liking.) + +Place `onedark.vim` in your `~/.vim/autoload/airline/themes/` directory either manually or by using your Vim plug-in manager of choice, then add the following line to your `~/.vimrc`: + + ```vim + let g:airline_theme='onedark' + ``` + +--- + +Preview images were taken using: + +* [iTerm2](https://iterm2.com) terminal emulator on Mac OS X +* 12 pt. [PragmataPro Mono](http://www.fsd.it/fonts/pragmatapro.htm#.VlDa1q6rTOY) font +* [vim-polyglot](https://github.com/sheerun/vim-polyglot) plug-in diff --git a/autoload/airline/themes/onedark.vim b/autoload/airline/themes/onedark.vim new file mode 100644 index 0000000..08d1849 --- /dev/null +++ b/autoload/airline/themes/onedark.vim @@ -0,0 +1,52 @@ +" [onedark.vim](https://github.com/joshdick/airline-onedark.vim/) + +" This is a [vim-airline](https://github.com/bling/vim-airline) theme for use with +" the [onedark.vim](https://github.com/joshdick/onedark.vim) colorscheme. + +" It is based on vim-airline's ["tomorrow" theme](https://github.com/bling/vim-airline/blob/master/autoload/airline/themes/tomorrow.vim). + +let g:airline#themes#onedark#palette = {} + +function! airline#themes#onedark#refresh() + let g:airline#themes#onedark#palette.accents = { + \ 'red': airline#themes#get_highlight('Constant'), + \ } + + let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['String', 'fg']) + let s:N2 = airline#themes#get_highlight('Pmenu') + let s:N3 = airline#themes#get_highlight('String') + let g:airline#themes#onedark#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) + + let group = airline#themes#get_highlight('vimCommand') + let g:airline#themes#onedark#palette.normal_modified = { + \ 'airline_c': [ group[0], '', group[2], '', '' ] + \ } + + let s:I1 = airline#themes#get_highlight('Cursor') + let s:I2 = s:N2 + let s:I3 = airline#themes#get_highlight2(['Cursor', 'bg'], ['Normal', 'bg']) + let g:airline#themes#onedark#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) + let g:airline#themes#onedark#palette.insert_modified = g:airline#themes#onedark#palette.normal_modified + + let s:R1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Error', 'fg']) + let s:R2 = s:N2 + let s:R3 = airline#themes#get_highlight('Error') + let g:airline#themes#onedark#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) + let g:airline#themes#onedark#palette.replace_modified = g:airline#themes#onedark#palette.normal_modified + + let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Statement', 'fg']) + let s:V2 = s:N2 + let s:V3 = airline#themes#get_highlight2(['Statement', 'fg'], ['Normal', 'bg']) + let g:airline#themes#onedark#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) + let g:airline#themes#onedark#palette.visual_modified = g:airline#themes#onedark#palette.normal_modified + + let s:IA1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Normal', 'fg']) + let s:IA2 = airline#themes#get_highlight2(['Normal', 'fg'], ['Visual', 'bg']) + let s:IA3 = s:N2 + let g:airline#themes#onedark#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3) + let g:airline#themes#onedark#palette.inactive_modified = { + \ 'airline_c': [ group[0], '', group[2], '', '' ] + \ } +endfunction + +call airline#themes#onedark#refresh() diff --git a/preview_airline.png b/preview_airline.png new file mode 100644 index 0000000..4526715 Binary files /dev/null and b/preview_airline.png differ