Initial commit.

This commit is contained in:
Matt Swensen 2016-11-21 06:53:23 -07:00
commit d5bbcbfbc2
6 changed files with 1813 additions and 0 deletions

3
.babelrc Normal file

@ -0,0 +1,3 @@
{
"presets": ["latest"]
}

10
.editorconfig Normal file

@ -0,0 +1,10 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

2
.gitignore vendored Normal file

@ -0,0 +1,2 @@
node_modules
lib

21
package.json Normal file

@ -0,0 +1,21 @@
{
"name": "themer-vim",
"version": "1.0.0",
"description": "Vim template for themer.",
"main": "lib/index.js",
"author": "mjswensen",
"repository": {
"url": "git@github.com:mjswensen/themer-vim.git",
"type": "git"
},
"license": "MIT",
"scripts": {
"build": "babel --out-dir lib src",
"start": "watch 'yarn run build' src"
},
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-preset-latest": "^6.16.0",
"watch": "^1.0.1"
}
}

145
src/index.js Normal file

@ -0,0 +1,145 @@
export const render = (colors, options) => {
const colorVars = colorSet => `
let s:shade0 = "${colorSet.shade0}"
let s:shade1 = "${colorSet.shade1}"
let s:shade2 = "${colorSet.shade2}"
let s:shade3 = "${colorSet.shade3}"
let s:shade4 = "${colorSet.shade4}"
let s:shade5 = "${colorSet.shade5}"
let s:shade6 = "${colorSet.shade6}"
let s:shade7 = "${colorSet.shade7}"
let s:accent0 = "${colorSet.accent0}"
let s:accent1 = "${colorSet.accent1}"
let s:accent2 = "${colorSet.accent2}"
let s:accent3 = "${colorSet.accent3}"
let s:accent4 = "${colorSet.accent4}"
let s:accent5 = "${colorSet.accent5}"
let s:accent6 = "${colorSet.accent6}"
let s:accent7 = "${colorSet.accent7}"
`;
const theme = `
${!!colors.dark ? `
if &background == 'dark'
${colorVars(colors.dark)}
endif
` : ''}
${!!colors.light ? `
if &background == 'light'
${colorVars(colors.light)}
endif
` : ''}
highlight clear
syntax reset
let g:colors_name = "themer-vim"
""""""""""
" Normal "
""""""""""
exec "hi Normal guifg=".s:shade6." guibg=".s:shade0
"""""""""""""""""
" Syntax groups "
"""""""""""""""""
" Default
exec "hi Comment guifg=".s:shade2
exec "hi Constant guifg=".s:accent3
exec "hi Character guifg=".s:accent4
exec "hi Identifier guifg=".s:accent2." gui=none cterm=none"
exec "hi Statement guifg=".s:accent5
exec "hi PreProc guifg=".s:accent6
exec "hi Type guifg=".s:accent7
exec "hi Special guifg=".s:accent4
exec "hi Underlined guifg=".s:accent5
exec "hi Error guifg=".s:shade0." guibg=".s:accent0
exec "hi Todo guifg=".s:accent2." guibg=".s:shade1
" GitGutter
exec "hi GitGutterAdd guifg=".s:accent3
exec "hi GitGutterChange guifg=".s:accent2
exec "hi GitGutterDelete guifg=".s:accent0
" fugitive
exec "hi gitcommitComment guifg=".s:shade3
exec "hi gitcommitOnBranch guifg=".s:shade3
exec "hi gitcommitHeader guifg=".s:shade5
exec "hi gitcommitHead guifg=".s:shade3
exec "hi gitcommitSelectedType guifg=".s:accent3
exec "hi gitcommitSelectedFile guifg=".s:accent3
exec "hi gitcommitDiscardedType guifg=".s:accent2
exec "hi gitcommitDiscardedFile guifg=".s:accent2
exec "hi gitcommitUntrackedFile guifg=".s:accent0
"""""""""""""""""""""""
" Highlighting Groups "
"""""""""""""""""""""""
" Default
exec "hi ColorColumn guibg=".s:shade1
exec "hi Conceal guifg=".s:shade2
exec "hi Cursor guifg=".s:shade0
exec "hi CursorColumn guibg=".s:shade1
exec "hi CursorLine guibg=".s:shade1
exec "hi Directory guifg=".s:accent5
exec "hi DiffAdd guifg=".s:accent3." guibg=".s:shade1
exec "hi DiffChange guifg=".s:accent2." guibg=".s:shade1
exec "hi DiffDelete guifg=".s:accent0." guibg=".s:shade1
exec "hi DiffText guifg=".s:accent2." guibg=".s:shade2
exec "hi ErrorMsg guifg=".s:shade7." guibg=".s:accent0
exec "hi VertSplit guibg=".s:shade2
exec "hi Folded guifg=".s:shade7." guibg=".s:shade2
exec "hi FoldColumn guifg=".s:shade7." guibg=".s:shade1
exec "hi SignColumn guibg=".s:shade0
exec "hi IncSearch guifg=".s:shade0." guibg=".s:accent2
exec "hi LineNr guifg=".s:shade2." guibg=".s:shade0
exec "hi CursorLineNr guifg=".s:shade2." guibg=".s:shade1
exec "hi MatchParen guibg=".s:shade2
exec "hi MoreMsg guifg=".s:shade0." guibg=".s:accent4
exec "hi NonText guifg=".s:shade2." guibg=".s:shade0
exec "hi Pmenu guifg=".s:shade6." guibg=".s:shade1
exec "hi PmenuSel guifg=".s:accent4." guibg=".s:shade1
exec "hi PmenuSbar guifg=".s:accent3." guibg=".s:shade1
exec "hi PmenuThumb guifg=".s:accent0." guibg=".s:shade2
exec "hi Question guifg=".s:shade7." guibg=".s:shade1
exec "hi Search guifg=".s:shade0." guibg=".s:accent2
exec "hi SpecialKey guifg=".s:accent7." guibg=".s:shade0
exec "hi SpellBad gui=undercurl guisp=".s:accent0
exec "hi SpellCap gui=undercurl guisp=".s:accent2
exec "hi SpellLocal gui=undercurl guisp=".s:accent4
exec "hi SpellRare gui=undercurl guisp=".s:accent1
exec "hi StatusLine guifg=".s:shade4." guibg=".s:shade1." gui=none cterm=none"
exec "hi TabLine guifg=".s:shade5." guibg=".s:shade1
exec "hi TabLineFill guibg=".s:shade1
exec "hi TabLineSel guifg=".s:shade6." guibg=".s:shade0
exec "hi Title guifg=".s:accent5
exec "hi Visual guibg=".s:shade1
exec "hi VisualNOS guifg=".s:accent0." guibg=".s:shade1
exec "hi WarningMsg guifg=".s:accent0
exec "hi WildMenu guifg=".s:accent4." guibg=".s:shade1
" NERDTree
exec "hi NERDTreeExecFile guifg=".s:accent4
exec "hi NERDTreeDirSlash guifg=".s:accent5
exec "hi NERDTreeCWD guifg=".s:accent0
""""""""""""
" Clean up "
""""""""""""
unlet s:shade0 s:shade1 s:shade2 s:shade3 s:shade4 s:shade5 s:shade6 s:shade7 s:accent0 s:accent1 s:accent2 s:accent3 s:accent4 s:accent5 s:accent6 s:accent7
`;
return [Promise.resolve({name: 'themer-vim.vim', contents: new Buffer(theme, 'utf-8')})];
};

1632
yarn.lock Normal file

File diff suppressed because it is too large Load Diff