" ------------------- jinx ---------------------- " " written by Nathaniel Maia, 2017 - 2019 " " ----------------------------------------------- " " ---------- Setup and Checks ----------- " {{{1 if exists('syntax_on') " {{{2 highlight clear syntax reset endif " color definitions {{{2 " start with an empty color dictionary let s:jinx = {} " NOTE: For those looking to edit the theme " " Color definition is done for both true color " and 256 color. The format is in ['HEX', 256color, 16color] " " let s:jinx.black = ['#000000', 0, 0] let g:terminal_ansi_colors = [ \ '#4D545E', '#D9534F', '#80B080', '#FFEB56', '#6699CC', '#CC99CC', '#5DD5FF', '#E1E1E1', \ '#4D545E', '#D9534F', '#80B080', '#FFEB56', '#6699CC', '#CC99CC', '#5DD5FF', '#E1E1E1' \ ] let s:i = 0 for s:color in g:terminal_ansi_colors let g:terminal_color_{s:i} = s:color let s:i += 1 endfor let s:jinx.red = ['#EE5555', 210, 1] let s:jinx.green = ['#88BB88', 108, 2] let s:jinx.yellow = ['#FFCC66', 220, 3] let s:jinx.blue = ['#4488CC', 32, 4] let s:jinx.purple = ['#AA88CC', 140, 5] let s:jinx.cyan = ['#44CCEE', 81, 6] let s:jinx.orange = ['#FF8844', 172, 9] if exists('g:jinx_theme') && g:jinx_theme =~? 'day' set background=light let s:jinx.fgr = ['#494949', 238, 0] let s:jinx.bgr = ['#E1E1E1', 254, 7] let s:jinx.line = ['#D0D0D0', 252, 15] let s:jinx.select = ['#D0D0D0', 252, 1] let s:jinx.folded = ['#B2B2B2', 249, 15] let s:jinx.commnt = ['#808080', 244, 15] let s:jinx.yellow = ['#EE9911', 178, 3] let s:jinx.cyan = ['#3388AA', 37, 6] elseif exists('g:jinx_theme') && g:jinx_theme =~? 'midnight' set background=dark let s:jinx.fgr = ['#CCCCCC', 251, 15] let s:jinx.bgr = ['#111111', 234, 0] let s:jinx.line = ['#2A2A2F', 237, 8] let s:jinx.select = ['#2A2A2F', 237, 1] let s:jinx.folded = ['#2A2A2F', 237, 8] let s:jinx.commnt = ['#777777', 243, 7] else " night set background=dark let s:jinx.fgr = ['#E1E1E1', 254, 15] let s:jinx.bgr = ['#4D545E', 237, 0] let s:jinx.line = ['#5F6772', 243, 8] let s:jinx.select = ['#5F6772', 243, 8] let s:jinx.folded = ['#5F6772', 243, 8] let s:jinx.commnt = ['#B9B9B9', 250, 7] endif function! hlg(GRP, FG, BG, ATT) abort " {{{2 if a:FG !=# '' let l:fg_col = get(s:jinx, a:FG) let l:fg_true = l:fg_col[0] if $TERM =~? 'linux' || &t_Co < 256 let l:fg_term = l:fg_col[2] else let l:fg_term = l:fg_col[1] endif exec 'highlight! '.a:GRP.' guifg='.l:fg_true.' ctermfg='.l:fg_term endif if a:BG !=# '' let l:bg_col = get(s:jinx, a:BG) let l:bg_true = l:bg_col[0] if $TERM =~? 'linux' || &t_Co < 256 let l:bg_term = l:bg_col[2] else let l:bg_term = l:bg_col[1] endif exec 'highlight! '.a:GRP.' guibg='.l:bg_true.' ctermbg='.l:bg_term endif if a:ATT !=# '' exec 'highlight! '.a:GRP.' gui='.a:ATT.' cterm='.a:ATT endif endfunction " ---------- Highlight Groups ------------ " {{{1 " Editor {{{2 call hlg('Title', 'commnt', 'bgr', 'bold') call hlg('Visual', '', 'select', '') call hlg('SignColumn', '', 'line', '') call hlg('CursorLine', '', 'line', '') call hlg('CursorColumn', '', 'line', '') call hlg('CursorLineNr', 'cyan', 'line', '') call hlg('LineNr', 'commnt', 'line', '') call hlg('ColorColumn', 'fgr', 'red', '') call hlg('Error', 'red', 'bgr', '') call hlg('ErrorMsg', 'red', 'bgr', '') call hlg('WarningMsg', 'red', 'bgr', '') call hlg('MatchParen', 'yellow', 'bgr', '') call hlg('ModeMsg', 'cyan', 'bgr', '') call hlg('MoreMsg', 'cyan', 'bgr', '') call hlg('Directory', 'blue', 'bgr', '') call hlg('Question', 'green', 'bgr', '') call hlg('NonText', 'commnt', 'bgr', '') call hlg('SpecialKey', 'commnt', 'bgr', '') call hlg('Folded', 'commnt', 'folded', '') call hlg('Search', 'bgr', 'blue', '') call hlg('HLNext', 'bgr', 'red', '') call hlg('Normal', 'fgr', 'bgr', '') call hlg('VertSplit', 'line', 'commnt', '') " Tabline {{{2 call hlg('TabLine', 'fgr', 'line', '') call hlg('TabLineFill', 'line', 'line', '') call hlg('TabLineSel', 'line', 'green', '') call hlg('WildMenu', 'bgr', 'fgr', '') call hlg('Pmenu', 'bgr', 'commnt', '') call hlg('PmenuSel', 'fgr', 'bgr', '') call hlg('PmenuSbar', 'commnt', 'line', '') call hlg('PmenuThumb', 'commnt', 'line', '') call hlg('StatusLine', 'line', 'fgr', '') call hlg('StatusLineNC', 'fgr', 'line', '') " Spelling {{{2 call hlg('SpellBad', '', '', 'underline') call hlg('SpellLocal', '', '', 'underline') call hlg('SpellRare', '', '', 'underline') " ALE linter {{{2 call hlg('ALEErrorSign', 'red', 'line', '') call hlg('ALEWarningSign', 'orange', 'line', '') call hlg('ALEError', 'red', '', 'underline') call hlg('ALEWarning', 'red', '', 'underline') call hlg('ALEStyleError', 'orange', '', 'underline') call hlg('ALEStyleWarning', 'orange', '', 'underline') " Generic {{{2 call hlg('Comment', 'commnt', '', '') call hlg('Todo', 'red', '', '') call hlg('Exception', 'red', '', '') call hlg('Float', 'cyan', '', '') call hlg('Number', 'cyan', '', '') call hlg('Include', 'cyan', '', '') call hlg('Character', 'blue', '', '') call hlg('Operator', 'blue', '', '') call hlg('String', 'blue', '', '') call hlg('Label', 'green', '', '') call hlg('Repeat', 'purple', '', '') call hlg('Statement', 'green', '', '') call hlg('Conditional', 'green', '', '') call hlg('Boolean', 'green', '', '') call hlg('Keyword', 'green', '', '') call hlg('Macro', 'purple', '', '') call hlg('Define', 'purple', '', '') call hlg('Special', 'purple', '', '') call hlg('Tag', 'purple', '', '') call hlg('Type', 'purple', '', '') call hlg('TypeDef', 'purple', '', '') call hlg('Structure', 'purple', '', '') call hlg('StorageClass', 'purple', '', '') call hlg('PreProc', 'yellow', '', '') call hlg('Constant', 'yellow', '', '') call hlg('Identifier', 'yellow', '', '') call hlg('PreCondit', 'yellow', '', '') call hlg('Conceal', 'orange', '', '') call hlg('Function', 'orange', '', '') " Vim {{{2 call hlg('vimCommand', 'green', '', '') call hlg('vimVar', 'yellow', '', '') call hlg('vimGroup', 'yellow', '', '') call hlg('vimGroupName', 'yellow', '', '') call hlg('VimFunction', 'orange', '', '') call hlg('VimFunctionKey', 'orange', '', '') call hlg('vimMapModKey', 'purple', '', '') call hlg('vimBracket', 'purple', '', '') call hlg('vimOption', 'purple', '', '') call hlg('vimMapMod', 'purple', '', '') call hlg('vimNotation', 'purple', '', '') " Shell {{{2 call hlg('shSet', 'green', '', '') call hlg('shLoop', 'green', '', '') call hlg('shFor', 'yellow', '', '') call hlg('shTestOpr', 'blue', '', '') call hlg('shConstant', 'yellow', '', '') call hlg('shFunctionKey', 'orange', '', '') call hlg('shStatement', 'green', '', '') call hlg('shKeyword', 'purple', '', '') call hlg('zshStatement', 'green', '', '') call hlg('zshOption', 'purple', '', '') call hlg('zshParentheses', 'purple', '', '') call hlg('zshBrackets', 'purple', '', '') call hlg('zshRepeat', 'green', '', '') call hlg('zshRedir', 'fgr', '', '') call hlg('zshFunction', 'orange', '', '') call hlg('zshVariableDef', 'yellow', '', '') call hlg('zshVariable', 'yellow', '', '') call hlg('zshOperator', 'blue', '', '') call hlg('zshPreProc', 'commnt', '', '') " C {{{2 call hlg('cConditional', 'green', '', '') call hlg('cRepeat', 'purple', '', '') call hlg('cStorageClass', 'purple', '', '') call hlg('cType', 'yellow', '', '') " PHP {{{2 call hlg('phpMemberSelector', 'blue', '', '') call hlg('phpVarSelector', 'red', '', '') call hlg('phpConditional', 'green', '', '') call hlg('phpStatement', 'green', '', '') call hlg('phpKeyword', 'purple', '', '') call hlg('phpRepeat', 'purple', '', '') " Ruby {{{2 call hlg('rubyInclude', 'blue', '', '') call hlg('rubyAttribute', 'blue', '', '') call hlg('rubySymbol', 'green', '', '') call hlg('rubyStringDelimiter', 'green', '', '') call hlg('rubyRepeat', 'purple', '', '') call hlg('rubyControl', 'purple', '', '') call hlg('rubyConditional', 'purple', '', '') call hlg('rubyException', 'purple', '', '') call hlg('rubyCurlyBlock', 'orange', '', '') call hlg('rubyLocalVariableOrMethod', 'orange', '', '') call hlg('rubyInterpolationDelimiter', 'orange', '', '') call hlg('rubyAccess', 'yellow', '', '') call hlg('rubyConstant', 'yellow', '', '') " Python {{{2 call hlg('pythonRun', 'red', '', '') call hlg('pythonOperator', 'blue', '', '') call hlg('pythonClass', 'blue', '', '') call hlg('pythonClassParameters', 'purple', '', '') call hlg('pythonParam', 'purple', '', '') call hlg('pythonDecorator', 'blue', '', '') call hlg('pythonExClass', 'blue', '', '') call hlg('pythonException', 'blue', '', '') call hlg('pythonExceptions', 'blue', '', '') call hlg('pythonBrackets', 'blue', '', '') call hlg('pythonEscape', 'blue', '', '') call hlg('pythonImport', 'green', '', '') call hlg('pythonRepeat', 'green', '', '') call hlg('pythonCoding', 'green', '', '') call hlg('pythonInclude', 'green', '', '') call hlg('pythonPreCondit', 'green', '', '') call hlg('pythonStatement', 'green', '', '') call hlg('pythonConditional', 'green', '', '') call hlg('pythonDef', 'yellow', '', '') call hlg('pythonSelf', 'blue', '', '') call hlg('pythonBuiltinType', 'purple', '', '') call hlg('pythonBuiltin', 'purple', '', '') call hlg('pythonBuiltinObj', 'purple', '', '') call hlg('pythonBuiltinFunc', 'orange', '', '') call hlg('pythonDot', 'orange', '', '') call hlg('pythonLambda', 'orange', '', '') call hlg('pythonLambdaExpr', 'orange', '', '') call hlg('pythonFunction', 'orange', '', '') call hlg('pythonDottedName', 'orange', '', '') call hlg('pythonBuiltinObjs', 'orange', '', '') " LaTeX {{{2 call hlg('texZone', 'red', '', 'none') call hlg('texStatement', 'blue', '', 'none') call hlg('texRefLabel', 'blue', '', 'none') call hlg('texRefZone', 'green', '', 'none') call hlg('texMath', 'orange', '', 'none') call hlg('texMathZoneX', 'orange', '', 'none') call hlg('texMathZoneA', 'orange', '', 'none') call hlg('texMathZoneB', 'orange', '', 'none') call hlg('texMathZoneC', 'orange', '', 'none') call hlg('texMathZoneD', 'orange', '', 'none') call hlg('texMathZoneE', 'orange', '', 'none') call hlg('texMathMatcher', 'orange', '', 'none') call hlg('texDelimiter', 'purple', '', 'none') call hlg('texComment', 'commnt', '', 'none') " JavaScript {{{2 call hlg('javaScriptNumber', 'cyan', '', '') call hlg('javascriptNull', 'red', '', '') call hlg('javascriptStatement', 'green', '', '') call hlg('javaScriptConditional', 'green', '', '') call hlg('javaScriptRepeat', 'purple', '', '') call hlg('javaScriptBraces', 'purple', '', '') call hlg('javascriptGlobal', 'yellow', '', '') call hlg('javaScriptFunction', 'orange', '', '') call hlg('javaScriptMember', 'orange', '', '') " HTML {{{2 call hlg('htmlTag', 'red', '', '') call hlg('htmlTagName', 'red', '', '') call hlg('htmlLink', 'blue', '', '') call hlg('htmlArg', 'green', '', '') call hlg('htmlScriptTag', 'purple', '', '') call hlg('htmlTitle', 'blue', '', '') call hlg('htmlH1', 'blue', '', '') call hlg('htmlH2', 'cyan', '', '') call hlg('htmlH3', 'cyan', '', '') call hlg('htmlH4', 'green', '', '') call hlg('htmlH5', 'green', '', '') " YAML {{{2 call hlg('yamlKey', 'red', '', '') call hlg('yamlAnchor', 'red', '', '') call hlg('yamlAlias', 'blue', '', '') call hlg('yamlDocumentHeader', 'green', '', '') " Markdown {{{2 call hlg('markdownHeadingRule', 'red', '', '') call hlg('markdownHeadingDelimiter', 'red', '', '') call hlg('markdownListMarker', 'blue', '', '') call hlg('markdownOrderedListMarker', 'blue', '', '') call hlg('markdownCode', 'purple', '', '') call hlg('markdownCodeBlock', 'purple', '', '') call hlg('markdownCodeDelimiter', 'purple', '', '') call hlg('markdownH1', 'blue', '', '') call hlg('markdownH2', 'blue', '', '') call hlg('markdownH3', 'cyan', '', '') call hlg('markdownH4', 'cyan', '', '') call hlg('markdownH5', 'green', '', '') " ShowMarks {{{2 call hlg('ShowMarksHLm', 'cyan', '', '') call hlg('ShowMarksHLl', 'orange', '', '') call hlg('ShowMarksHLo', 'purple', '', '') call hlg('ShowMarksHLu', 'yellow', '', '') " Lua {{{2 call hlg('luaRepeat', 'purple', '', '') call hlg('luaStatement', 'purple', '', '') call hlg('luaCond', 'green', '', '') call hlg('luaCondEnd', 'green', '', '') call hlg('luaCondStart', 'green', '', '') call hlg('luaCondElseif', 'green', '', '') " Go {{{2 call hlg('goDeclType', 'blue', '', '') call hlg('goLabel', 'purple', '', '') call hlg('goRepeat', 'purple', '', '') call hlg('goBuiltins', 'purple', '', '') call hlg('goStatement', 'purple', '', '') call hlg('goDirective', 'purple', '', '') call hlg('goDeclaration', 'purple', '', '') call hlg('goConditional', 'purple', '', '') call hlg('goTodo', 'yellow', '', '') call hlg('goConstants', 'orange', '', '') " Clojure {{{2 call hlg('clojureException', 'red', '', '') call hlg('clojureParen', 'cyan', '', '') call hlg('clojureCond', 'blue', '', '') call hlg('clojureFunc', 'blue', '', '') call hlg('clojureMeta', 'blue', '', '') call hlg('clojureMacro', 'blue', '', '') call hlg('clojureDeref', 'blue', '', '') call hlg('clojureQuote', 'blue', '', '') call hlg('clojureRepeat', 'blue', '', '') call hlg('clojureRepeat', 'blue', '', '') call hlg('clojureUnquote', 'blue', '', '') call hlg('clojureAnonArg', 'blue', '', '') call hlg('clojureDispatch', 'blue', '', '') call hlg('clojureString', 'green', '', '') call hlg('clojureRegexp', 'green', '', '') call hlg('clojureKeyword', 'green', '', '') call hlg('clojureDefine', 'purple', '', '') call hlg('clojureSpecial', 'purple', '', '') call hlg('clojureVariable', 'yellow', '', '') call hlg('clojureBoolean', 'orange', '', '') call hlg('clojureNumber', 'orange', '', '') call hlg('clojureConstant', 'orange', '', '') call hlg('clojureCharacter', 'orange', '', '') " Scala {{{2 call hlg('scalaPackage', 'red', '', '') call hlg('scalaVar', 'cyan', '', '') call hlg('scalaDefName', 'blue', '', '') call hlg('scalaBackTick', 'blue', '', '') call hlg('scalaMethodCall', 'blue', '', '') call hlg('scalaXml', 'green', '', '') call hlg('scalaString', 'green', '', '') call hlg('scalaBackTick', 'green', '', '') call hlg('scalaEmptyString', 'green', '', '') call hlg('scalaStringEscape', 'green', '', '') call hlg('scalaMultiLineString', 'green', '', '') call hlg('scalaTypeSpecializer', 'yellow', '', '') call hlg('scalaDefSpecializer', 'yellow', '', '') call hlg('scalaType', 'yellow', '', '') call hlg('scalaCaseType', 'yellow', '', '') call hlg('scalaAnnotation', 'orange', '', '') call hlg('scalaSymbol', 'orange', '', '') call hlg('scalaUnicode', 'orange', '', '') call hlg('scalaBoolean', 'orange', '', '') call hlg('scalaNumber', 'orange', '', '') call hlg('scalaChar', 'orange', '', '') call hlg('scalaImport', 'purple', '', '') call hlg('scalaDef', 'purple', '', '') call hlg('scalaVal', 'purple', '', '') call hlg('scalaClass', 'purple', '', '') call hlg('scalaTrait', 'purple', '', '') call hlg('scalaObject', 'purple', '', '') call hlg('scalaKeywordModifier', 'purple', '', '') call hlg('scalaDocComment', 'commnt', '', '') call hlg('scalaComment', 'commnt', '', '') call hlg('scalaDocTags', 'commnt', '', '') call hlg('scalaLineComment', 'commnt', '', '') " Diff {{{2 call hlg('DiffDelete', 'red', '', '') call hlg('DiffChange', 'blue', '', '') call hlg('DiffAdd', 'green', '', '') call hlg('DiffText', 'line', 'blue', '') " Cleanup {{{2 " Remove the highlight function as it's no longer needed. " Will cause problems reloading the theme if not deleted. delfunction hlg let g:colors_name = 'jinx' " vim:fdm=marker