Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Dracula colorscheme #34

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Use your favorite package-manager to install, and enjoy!
| [challenger-deep] | FlatColor colorscheme | ✓ | ✓ |
| [deep-space] | Intergalactic friendly color scheme based off Hybrid | ✓ | ✓ |
| [deus] | For the late night coder | ✓ | ✓ |
| [dracula] | 🧛 Dark theme for Vim | ✓ | ✓ |
| [dogrun] | Dark purple | ✓ | ✓ |
| [flattened] | Solarized, without the bullshit | ✓ (16) | ✓ |
| [focuspoint] | Maintain color coordination and important keyword focus | | ✓ |
Expand Down Expand Up @@ -87,6 +88,7 @@ Use your favorite package-manager to install, and enjoy!
[challenger-deep]: https://github.com/challenger-deep-theme/vim
[deep-space]: https://github.com/tyrannicaltoucan/vim-deep-space
[deus]: https://github.com/ajmwagar/vim-deus
[dracula]: https://github.com/dracula/vim
[dogrun]: https://github.com/wadackel/vim-dogrun
[flattened]: https://github.com/romainl/flattened
[focuspoint]: https://github.com/chase/focuspoint-vim
Expand Down
160 changes: 160 additions & 0 deletions autoload/airline/themes/dracula.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
" Dracula Airline Theme: {{{
"
" Copyright 2016, All rights reserved
"
" Code licensed under the MIT license
" http://zenorocha.mit-license.org
"
" @author Extrante <[email protected]>
" @author Zeno Rocha <[email protected]>
"}}}
" Helpers: {{{

" Takes a foreground color name, background color name, and optionally one or
" more attr-list items as input, transforms it to the format accepted by
" airline#themes#generate_color_map and returns that value
func! s:clr(fg, bg, ...)
let l:fg = g:dracula#palette[a:fg]
let l:bg = g:dracula#palette[a:bg]
return [ l:fg[0], l:bg[0], l:fg[1], l:bg[1] ] +
\ filter(copy(a:000), 'type(v:val) == 1 && len(v:val) > 0')
endfunc

" Takes three ['fg', 'bg'] color lists and optionally a dictionary of extra
" key-value pairs and returns the value generated by
" airline#themes#generate_color_map after optionally merging the dictionary of
" extra key-value pairs.
"
" a:a -> airline_a, airline_x
" a:b -> airline_b, airline_y
" a:c -> airline_c, airline_z
func! s:color_map(a, b, c, ...)
if a:0 == 0
return call('airline#themes#generate_color_map', [call('s:clr', a:a), call('s:clr', a:b), call('s:clr', a:c)])
else
return call('extend', [ call('airline#themes#generate_color_map', [call('s:clr', a:a), call('s:clr', a:b), call('s:clr', a:c)]) ] + a:000)
endif
endfunc

"}}}

let g:airline#themes#dracula#palette = {
\ 'normal': s:color_map(
\ ['bg', 'purple'],
\ ['fg', 'comment'],
\ ['fg', 'selection'],
\ {
\ 'airline_warning': s:clr('bg', 'orange'),
\ 'airline_error': s:clr('bg', 'red'),
\ },
\ ),
\ 'normal_modified': s:color_map(
\ ['bg', 'purple'],
\ ['fg', 'comment'],
\ ['fg', 'bgdark'],
\ {
\ 'airline_warning': s:clr('bg', 'orange'),
\ 'airline_error': s:clr('bg', 'red'),
\ },
\ ),
\ 'insert': s:color_map(
\ ['bg', 'green'],
\ ['fg', 'comment'],
\ ['fg', 'selection'],
\ {
\ 'airline_warning': s:clr('bg', 'orange'),
\ 'airline_error': s:clr('bg', 'red'),
\ },
\ ),
\ 'insert_modified': s:color_map(
\ ['bg', 'green'],
\ ['fg', 'comment'],
\ ['fg', 'bgdark'],
\ {
\ 'airline_warning': s:clr('bg', 'orange'),
\ 'airline_error': s:clr('bg', 'red'),
\ },
\ ),
\ 'replace': s:color_map(
\ ['bg', 'orange'],
\ ['fg', 'comment'],
\ ['fg', 'selection'],
\ {
\ 'airline_warning': s:clr('bg', 'orange'),
\ 'airline_error': s:clr('bg', 'red'),
\ },
\ ),
\ 'replace_modified': s:color_map(
\ ['bg', 'orange'],
\ ['fg', 'comment'],
\ ['fg', 'bgdark'],
\ {
\ 'airline_warning': s:clr('bg', 'orange'),
\ 'airline_error': s:clr('bg', 'red'),
\ },
\ ),
\ 'visual': s:color_map(
\ ['bg', 'yellow'],
\ ['fg', 'comment'],
\ ['fg', 'selection'],
\ {
\ 'airline_warning': s:clr('bg', 'orange'),
\ 'airline_error': s:clr('bg', 'red'),
\ },
\ ),
\ 'visual_modified': s:color_map(
\ ['bg', 'yellow'],
\ ['fg', 'comment'],
\ ['fg', 'bgdark'],
\ {
\ 'airline_warning': s:clr('bg', 'orange'),
\ 'airline_error': s:clr('bg', 'red'),
\ },
\ ),
\ 'inactive': s:color_map(
\ ['bg', 'comment'],
\ ['fg', 'bgdark'],
\ ['fg', 'selection'],
\ {
\ 'airline_warning': s:clr('bg', 'orange'),
\ 'airline_error': s:clr('bg', 'red'),
\ },
\ ),
\ 'terminal': s:color_map(
\ ['bg', 'green'],
\ ['fg', 'comment'],
\ ['fg', 'selection'],
\ {
\ 'airline_term': s:clr('fg', 'selection'),
\ },
\ ),
\}

" Extensions: {{{
" Tabline: {{{
if get(g:, 'airline#extensions#tabline#enabled', 0)
let g:airline#themes#dracula#palette.tabline = {
\ 'airline_tabfill': s:clr('bg', 'bglight'),
\
\ 'airline_tab': s:clr('comment', 'bg'),
\ 'airline_tabsel': s:clr('bg', 'purple'),
\ 'airline_tabmod': s:clr('green', 'bg'),
\
\ 'airline_tab_right': s:clr('comment', 'bg'),
\ 'airline_tabsel_right': s:clr('fg', 'bg', ),
\ 'airline_tabmod_right': s:clr('green', 'bg'),
\}
endif
"}}}
" CtrlP: {{{2
if exists('g:loaded_ctrlp')
let g:airline#themes#dracula#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
\ s:clr('fg', 'selection'),
\ s:clr('fg', 'comment'),
\ s:clr('fg', 'purple'),
\)
endif
"}}}2
"}}}

" vim: fdm=marker ts=2 sts=2 sw=2 fdl=0:
57 changes: 57 additions & 0 deletions autoload/dracula.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
" Palette: {{{

let g:dracula#palette = {}
let g:dracula#palette.fg = ['#F8F8F2', 253]

let g:dracula#palette.bglighter = ['#424450', 238]
let g:dracula#palette.bglight = ['#343746', 237]
let g:dracula#palette.bg = ['#282A36', 236]
let g:dracula#palette.bgdark = ['#21222C', 235]
let g:dracula#palette.bgdarker = ['#191A21', 234]

let g:dracula#palette.comment = ['#6272A4', 61]
let g:dracula#palette.selection = ['#44475A', 239]
let g:dracula#palette.subtle = ['#424450', 238]

let g:dracula#palette.cyan = ['#8BE9FD', 117]
let g:dracula#palette.green = ['#50FA7B', 84]
let g:dracula#palette.orange = ['#FFB86C', 215]
let g:dracula#palette.pink = ['#FF79C6', 212]
let g:dracula#palette.purple = ['#BD93F9', 141]
let g:dracula#palette.red = ['#FF5555', 203]
let g:dracula#palette.yellow = ['#F1FA8C', 228]

"
" ANSI
"
let g:dracula#palette.color_0 = '#21222C'
let g:dracula#palette.color_1 = '#FF5555'
let g:dracula#palette.color_2 = '#50FA7B'
let g:dracula#palette.color_3 = '#F1FA8C'
let g:dracula#palette.color_4 = '#BD93F9'
let g:dracula#palette.color_5 = '#FF79C6'
let g:dracula#palette.color_6 = '#8BE9FD'
let g:dracula#palette.color_7 = '#F8F8F2'
let g:dracula#palette.color_8 = '#6272A4'
let g:dracula#palette.color_9 = '#FF6E6E'
let g:dracula#palette.color_10 = '#69FF94'
let g:dracula#palette.color_11 = '#FFFFA5'
let g:dracula#palette.color_12 = '#D6ACFF'
let g:dracula#palette.color_13 = '#FF92DF'
let g:dracula#palette.color_14 = '#A4FFFF'
let g:dracula#palette.color_15 = '#FFFFFF'

" }}}

" Helper function that takes a variadic list of filetypes as args and returns
" whether or not the execution of the ftplugin should be aborted.
func! dracula#should_abort(...)
if ! exists('g:colors_name') || g:colors_name !=# 'dracula'
return 1
elseif a:0 > 0 && (! exists('b:current_syntax') || index(a:000, b:current_syntax) == -1)
return 1
endif
return 0
endfunction

" vim: fdm=marker ts=2 sts=2 sw=2 fdl=0:
42 changes: 42 additions & 0 deletions autoload/lightline/colorscheme/dracula.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
" =============================================================================
" Filename: autoload/lightline/colorscheme/dracula.vim
" Author: adamalbrecht
" License: MIT License
" Last Change: 2018/04/11
" =============================================================================

let s:black = g:dracula#palette.bg
let s:gray = g:dracula#palette.selection
let s:white = g:dracula#palette.fg
let s:darkblue = g:dracula#palette.comment
let s:cyan = g:dracula#palette.cyan
let s:green = g:dracula#palette.green
let s:orange = g:dracula#palette.orange
let s:purple = g:dracula#palette.purple
let s:red = g:dracula#palette.red
let s:yellow = g:dracula#palette.yellow

if exists('g:lightline')

let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
let s:p.normal.left = [ [ s:black, s:purple ], [ s:cyan, s:gray ] ]
let s:p.normal.right = [ [ s:black, s:purple ], [ s:white, s:darkblue ] ]
let s:p.inactive.right = [ [ s:black, s:darkblue ], [ s:white, s:black ] ]
let s:p.inactive.left = [ [ s:cyan, s:black ], [ s:white, s:black ] ]
let s:p.insert.left = [ [ s:black, s:green ], [ s:cyan, s:gray ] ]
let s:p.replace.left = [ [ s:black, s:red ], [ s:cyan, s:gray ] ]
let s:p.visual.left = [ [ s:black, s:orange ], [ s:cyan, s:gray ] ]
let s:p.normal.middle = [ [ s:white, s:gray ] ]
let s:p.inactive.middle = [ [ s:white, s:gray ] ]
let s:p.tabline.left = [ [ s:darkblue, s:gray ] ]
let s:p.tabline.tabsel = [ [ s:cyan, s:black ] ]
let s:p.tabline.middle = [ [ s:darkblue, s:gray ] ]
let s:p.tabline.right = copy(s:p.normal.right)
let s:p.normal.error = [ [ s:red, s:black ] ]
let s:p.normal.warning = [ [ s:yellow, s:black ] ]

let g:lightline#colorscheme#dracula#palette = lightline#colorscheme#flatten(s:p)

endif

" vim: fdm=marker ts=2 sts=2 sw=2 fdl=0:
Loading