[colorschemes] add name

This commit is contained in:
Dmytro Meleshko 2019-08-25 11:34:11 +03:00
parent 54455cbd00
commit 92c335b627
4 changed files with 16 additions and 10 deletions

View file

@ -1,6 +1,8 @@
#!/usr/bin/env python
# base16-eighties by Chris Kempson (http://chriskempson.com)
base16_name = "eighties"
name = "base16-" + base16_name
base16_colors = [
"#2d2d2d", # 0
"#393939", # 1

View file

@ -2,7 +2,9 @@
import _theme as theme
print("let colorscheme_base16_colors = [")
print("let my_colorscheme_name = '{}'".format(theme.name))
print("let my_colorscheme_base16_name = '{}'".format(theme.base16_name))
print("let my_colorscheme_base16_colors = [")
gui_to_cterm_mapping = [0, 18, 19, 8, 20, 7, 21, 15, 1, 16, 3, 2, 6, 4, 5, 17]
for colors_pair in zip(theme.base16_colors, gui_to_cterm_mapping):
print("\\ {{'gui': '{}', 'cterm': '{:>02}'}},".format(*colors_pair))

View file

@ -1,4 +1,6 @@
let colorscheme_base16_colors = [
let my_colorscheme_name = 'base16-eighties'
let my_colorscheme_base16_name = 'eighties'
let my_colorscheme_base16_colors = [
\ {'gui': '#2d2d2d', 'cterm': '00'},
\ {'gui': '#393939', 'cterm': '18'},
\ {'gui': '#515151', 'cterm': '19'},

View file

@ -1,20 +1,20 @@
" modified version of base16-vim (https://github.com/chriskempson/base16-vim)
" by Chris Kempson (http://chriskempson.com)
let s:base16_theme_name = 'eighties'
" Color definitions {{{
execute 'source' fnameescape(g:nvim_dotfiles_dir.'/../colorschemes/out/nvim.vim')
let s:colors = g:my_colorscheme_base16_colors
let s:theme_name = g:my_colorscheme_name
let s:base16_theme_name = g:my_colorscheme_base16_name
unlet g:my_colorscheme_name g:my_colorscheme_base16_name g:my_colorscheme_base16_colors
if empty($BASE16_SHELL) || !filereadable($BASE16_SHELL.'/scripts/base16-'.s:base16_theme_name.'.sh') || &termguicolors
set termguicolors
else
" call system(shellescape(s:base16_shell_script))
" call system(shellescape($BASE16_SHELL.'/scripts/base16-'.s:base16_theme_name.'.sh'))
endif
execute 'source' fnameescape(g:nvim_dotfiles_dir.'/../colorschemes/out/nvim.vim')
let s:colors = g:colorscheme_base16_colors
unlet g:colorscheme_base16_colors
" }}}
" Neovim terminal colors {{{
@ -32,7 +32,7 @@ let s:base16_theme_name = 'eighties'
" Theme setup {{{
hi clear
syntax reset
let g:colors_name = 'base16-' . s:base16_theme_name
let g:colors_name = s:theme_name
" }}}
" Highlighting function {{{