" Antares - dark colorscheme for vim-editor " Author - Haron Prime " License - © 2015 WTFPL, Do What the Fuck You Want to Public License. - http://www.wtfpl.net/ " Default GUI Colours let s:foreground = "bbbbbb" let s:background = "151515" let s:selection = "505050" let s:line = "151515" let s:activeline = "252525" let s:non_text = "151515" let s:comment = "757575" let s:red = "DE575C" let s:orange = "ED934C" let s:yellow = "EBE971" let s:lyme = "afdf00" let s:peach = "cca68e" let s:green = "00b853" let s:aqua = "4ae5e8" let s:olive = "afaf4f" let s:blue = "7fc6f0" let s:lightblue = "90d0f0" let s:purple = "CF9FFA" let s:window = "151515" let s:tab_bg = "353535" let s:tab_fg = "bbbbbb" let s:linenr_bg = "151515" let s:linenr_fg = "777777" let s:statusline_bg = "151515" let s:statusline_fg = "90d0f0" let s:cursor_bg = "555555" " Console 256 Colours if !has("gui_running") let s:background = "151515" let s:window = "151515" let s:line = "151515" let s:selection = "505050" end set background=dark hi clear syntax reset let g:colors_name = "antares" if has("gui_running") || &t_Co == 88 || &t_Co == 256 " Returns an approximate grey index for the given grey level fun grey_number(x) if &t_Co == 88 if a:x < 23 return 0 elseif a:x < 69 return 1 elseif a:x < 103 return 2 elseif a:x < 127 return 3 elseif a:x < 150 return 4 elseif a:x < 173 return 5 elseif a:x < 196 return 6 elseif a:x < 219 return 7 elseif a:x < 243 return 8 else return 9 endif else if a:x < 14 return 0 else let l:n = (a:x - 8) / 10 let l:m = (a:x - 8) % 10 if l:m < 5 return l:n else return l:n + 1 endif endif endif endfun " Returns the actual grey level represented by the grey index fun grey_level(n) if &t_Co == 88 if a:n == 0 return 0 elseif a:n == 1 return 46 elseif a:n == 2 return 92 elseif a:n == 3 return 115 elseif a:n == 4 return 139 elseif a:n == 5 return 162 elseif a:n == 6 return 185 elseif a:n == 7 return 208 elseif a:n == 8 return 231 else return 255 endif else if a:n == 0 return 0 else return 8 + (a:n * 10) endif endif endfun " Returns the palette index for the given grey index fun grey_colour(n) if &t_Co == 88 if a:n == 0 return 16 elseif a:n == 9 return 79 else return 79 + a:n endif else if a:n == 0 return 16 elseif a:n == 25 return 231 else return 231 + a:n endif endif endfun " Returns an approximate colour index for the given colour level fun rgb_number(x) if &t_Co == 88 if a:x < 69 return 0 elseif a:x < 172 return 1 elseif a:x < 230 return 2 else return 3 endif else if a:x < 75 return 0 else let l:n = (a:x - 55) / 40 let l:m = (a:x - 55) % 40 if l:m < 20 return l:n else return l:n + 1 endif endif endif endfun " Returns the actual colour level for the given colour index fun rgb_level(n) if &t_Co == 88 if a:n == 0 return 0 elseif a:n == 1 return 139 elseif a:n == 2 return 205 else return 255 endif else if a:n == 0 return 0 else return 55 + (a:n * 40) endif endif endfun " Returns the palette index for the given R/G/B colour indices fun rgb_colour(x, y, z) if &t_Co == 88 return 16 + (a:x * 16) + (a:y * 4) + a:z else return 16 + (a:x * 36) + (a:y * 6) + a:z endif endfun " Returns the palette index to approximate the given R/G/B colour levels fun colour(r, g, b) " Get the closest grey let l:gx = grey_number(a:r) let l:gy = grey_number(a:g) let l:gz = grey_number(a:b) " Get the closest colour let l:x = rgb_number(a:r) let l:y = rgb_number(a:g) let l:z = rgb_number(a:b) if l:gx == l:gy && l:gy == l:gz " There are two possibilities let l:dgr = grey_level(l:gx) - a:r let l:dgg = grey_level(l:gy) - a:g let l:dgb = grey_level(l:gz) - a:b let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) let l:dr = rgb_level(l:gx) - a:r let l:dg = rgb_level(l:gy) - a:g let l:db = rgb_level(l:gz) - a:b let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db) if l:dgrey < l:drgb " Use the grey return grey_colour(l:gx) else " Use the colour return rgb_colour(l:x, l:y, l:z) endif else " Only one possibility return rgb_colour(l:x, l:y, l:z) endif endfun " Returns the palette index to approximate the 'rrggbb' hex string fun rgb(rgb) let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0 let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0 let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0 return colour(l:r, l:g, l:b) endfun " Sets the highlighting for the given group fun X(group, fg, bg, attr) if a:fg != "" exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . rgb(a:fg) endif if a:bg != "" exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . rgb(a:bg) endif if a:attr != "" exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr endif endfun "UI Highlighting call X("Normal", s:foreground, s:background, "none") call X("LineNr", s:linenr_fg, s:linenr_bg, "") call X("NonText", s:non_text, "", "") call X("SpecialKey", s:selection, "", "") call X("Search", s:background, s:lightblue, "") call X("TabLine", s:tab_fg, s:tab_bg, "none") call X("TabLineFill", s:tab_bg, s:foreground, "") call X("TabLineSel", s:tab_fg, s:background, "") call X("StatusLine", s:statusline_bg, s:statusline_fg, "") call X("StatusLineNC", s:linenr_fg, s:linenr_bg, "none") call X("VertSplit", s:linenr_bg, s:linenr_bg, "none") call X("Visual", "", s:selection, "") call X("Directory", s:blue, "", "") call X("ModeMsg", s:green, "", "") call X("MoreMsg", s:green, "", "") call X("Question", s:green, "", "") call X("WarningMsg", s:red, "", "") call X("MatchParen", "", s:selection, "") call X("Folded", s:comment, s:background, "") call X("FoldColumn", "", s:background, "") hi CursorLine guibg=#202020 hi Cursor guifg=NONE guibg=#555555 gui=none if version >= 700 call X("CursorLine", "", s:activeline, "none") call X("CursorColumn", "", s:line, "none") call X("PMenu", s:foreground, s:selection, "none") call X("PMenuSel", s:foreground, s:selection, "reverse") call X("SignColumn", "", s:background, "none") end if version >= 703 call X("ColorColumn", "", s:line, "none") end " Standard Highlighting call X("Comment", s:comment, "", "") call X("Todo", s:red, s:background, "bold") call X("Title", s:comment, "", "") call X("Identifier", s:aqua, "", "none") call X("Statement", s:yellow, "", "none") call X("Conditional", s:blue, "", "") call X("Repeat", s:yellow, "", "") call X("Label", s:blue, "", "") call X("Structure", s:yellow, "", "") call X("Function", s:blue,"","") call X("Constant", s:orange, "", "") call X("String", s:green, "", "") call X("Special", s:blue, "", "") call X("PreProc", s:purple, "", "") call X("Operator", s:blue, "", "none") call X("Keyword", s:blue, "", "") call X("Exception", s:red, "", "") call X("Type", s:blue, "", "none") call X("Define", s:red, "", "none") call X("Include", s:blue, "", "") "call X("Ignore","666666","","") call X("Number", s:orange, "" , "") call X("Character", s:olive, "", "") call X("Boolean", s:green, "", "bold") call X("Float", s:orange, "", "") call X("Identifier", s:peach, "", "") call X("Macro", s:blue, "", "") call X("PreCondit", s:aqua, "", "") call X("StorageClass", s:peach, "", "bold") call X("Structure", s:blue, "", "bold") call X("Delimiter",s:aqua, "", "") call X("SpecialComment", s:comment, "", "bold") call X("Debug", s:orange, "", "") call X("Global", s:blue, "", "") " Vim Highlighting call X("vimCommand", s:red, "", "none") call X("vimVar", s:blue, "", "") call X("vimFuncKey", s:lyme, "", "") call X("vimFunction", s:blue, "", "bold") call X("vimNotFunc", s:lyme, "", "") call X("vimMap", s:red, "", "") call X("vimAutoEvent", s:aqua, "", "bold") call X("vimMapModKey", s:aqua, "", "") call X("vimFuncVar", s:aqua, "", "") call X("vimFuncName", s:aqua, "", "") call X("vimIsCommand", s:foreground, "", "") call X("vimLet", s:red, "", "") call X("vimMapRhsExtend", s:foreground, "", "") call X("vimCommentTitle", s:comment, "", "bold") call X("vimBracket", s:aqua, "", "") call X("vimParenSep", s:aqua, "", "") call X("vimSynType", s:olive, "", "bold") call X("vimNotation", s:aqua, "", "") call X("vimOper", s:foreground, "", "") " Makefile Highlighting call X("makeIdent", s:blue, "", "") call X("makeSpecTarget", s:olive, "", "") call X("makeTarget", s:red, "", "") call X("makeStatement", s:aqua, "", "bold") call X("makeCommands", s:foreground, "", "") call X("makeSpecial", s:orange, "", "bold") " CMake Highlighting call X("cmakeStatement", s:lyme, "", "") call X("cmakeArguments", s:foreground, "", "") call X("cmakeVariableValue", s:blue, "", "") call X("cmakeOperators", s:red, "", "") " C Highlighting call X("cType", s:blue, "", "") call X("cFormat", s:olive, "", "") call X("cBoolean", s:green, "", "") call X("cCharacter", s:olive, "", "") call X("cConstant", s:green, "", "bold") call X("cStorageClass", s:yellow, "", "") call X("cConditional", s:blue, "", "") call X("cSpecial", s:olive, "", "bold") call X("cNumber", s:orange, "", "") call X("cPreCondit", s:purple, "", "") call X("cRepeat", s:yellow, "", "") call X("cLabel",s:aqua, "", "") call X("cDefine", s:red, "", "") call X("cInclude", s:red, "", "") call X("cDelimiter",s:blue, "", "") call X("cOperator",s:aqua, "", "") call X("cFunction", s:foreground, "", "") call X("cCustomParen", s:foreground, "", "") call X("cOctalZero", s:purple, "", "bold") " CPP highlighting call X("cppBoolean", s:peach, "", "") call X("cppSTLnamespace", s:purple, "", "") call X("cppSTLconstant", s:foreground, "", "") call X("cppSTLtype", s:foreground, "", "") call X("cppSTLexception", s:lyme, "", "") call X("cppSTLfunctional", s:foreground, "", "bold") call X("cppSTLiterator", s:foreground, "", "bold") call X("cppExceptions", s:red, "", "") call X("cppStatement", s:blue, "", "") call X("cppStorageClass", s:peach, "", "bold") call X("cppAccess",s:blue, "", "") " Lex highlighting call X("lexCFunctions", s:foreground, "", "") call X("lexAbbrv", s:purple, "", "") call X("lexAbbrvRegExp", s:aqua, "", "") call X("lexAbbrvComment", s:comment, "", "") call X("lexBrace", s:peach, "", "") call X("lexPat", s:aqua, "", "") call X("lexPatComment", s:comment, "", "") call X("lexPatTag", s:orange, "", "") call X("lexSlashQuote", s:foreground, "", "") call X("lexSep", s:foreground, "", "") call X("lexStartState", s:orange, "", "") call X("lexPatTagZone", s:olive, "", "bold") call X("lexMorePat", s:olive, "", "bold") call X("lexOptions", s:olive, "", "bold") call X("lexPatString", s:olive, "", "") " Yacc highlighting call X("yaccNonterminal", s:peach, "", "") call X("yaccDelim", s:orange, "", "") call X("yaccInitKey", s:aqua, "", "") call X("yaccInit", s:peach, "", "") call X("yaccKey", s:purple, "", "") call X("yaccVar", s:aqua, "", "") " NASM highlighting call X("nasmStdInstruction", s:peach, "", "") call X("nasmGen08Register", s:aqua, "", "") call X("nasmGen16Register", s:aqua, "", "") call X("nasmGen32Register", s:aqua, "", "") call X("nasmGen64Register", s:aqua, "", "") call X("nasmHexNumber", s:purple, "", "") call X("nasmStorage", s:aqua, "", "bold") call X("nasmLabel", s:lyme, "", "") call X("nasmDirective", s:blue, "", "bold") call X("nasmLocalLabel", s:orange, "", "") " GAS highlighting call X("gasSymbol", s:lyme, "", "") call X("gasDirective", s:blue, "", "bold") call X("gasOpcode_386_Base", s:peach, "", "") call X("gasDecimalNumber", s:purple, "", "") call X("gasSymbolRef", s:lyme, "", "") call X("gasRegisterX86", s:blue, "", "") call X("gasOpcode_P6_Base", s:peach, "", "") call X("gasDirectiveStore", s:foreground, "", "bold") " MIPS highlighting call X("mipsInstruction", s:lyme, "", "") call X("mipsRegister", s:peach, "", "") call X("mipsLabel", s:aqua, "", "bold") call X("mipsDirective", s:purple, "", "bold") " PHP Highlighting call X("phpVarSelector", s:yellow, "", "") call X("phpKeyword", s:yellow, "", "") call X("phpIdentifier", s:blue, "", "") call X("phpType", s:aqua, "", "") call X("phpOperator", s:yellow,"","") call X("phpRepeat", s:yellow, "", "") call X("phpConditional", s:blue, "", "") call X("phpStatement", s:yellow, "", "") call X("phpMemberSelector", s:blue, "", "") call X("phpStringSingle", s:orange, "", "") call X("phpStringDelimiter", s:foreground, "", "") call X("phpDefine", s:red, "", "") call X("phpStorageClass", s:blue, "", "") call X("phpStructure", s:blue, "", "") call X("phpParent", s:foreground, "", "") call X("phpInclude", s:red, "", "") call X("phpMagicConstants", s:aqua, "", "") call X("phpFCKeyword", s:red, "", "") call X("phpSCKeyword", s:red, "", "") call X("phpConstant", s:aqua, "", "") call X("phpEnvVar", s:aqua, "", "") call X("phpIntVar", s:aqua, "", "") call X("phpCoreConstant", s:aqua, "", "") " Ruby Highlighting call X("rubySymbol", s:green, "", "") call X("rubyConstant", s:yellow, "", "") call X("rubyAttribute", s:blue, "", "") call X("rubyInclude", s:blue, "", "") call X("rubyLocalVariableOrMethod", s:orange, "", "") call X("rubyCurlyBlock", s:orange, "", "") call X("rubyStringDelimiter", s:green, "", "") call X("rubyInterpolationDelimiter", s:orange, "", "") call X("rubyConditional", s:purple, "", "") call X("rubyRepeat", s:purple, "", "") " Python Highlighting call X("pythonInclude", s:purple, "", "") call X("pythonConditional", s:blue, "", "") call X("pythonRepeat", s:yellow, "", "") call X("pythonException", s:blue, "", "") call X("pythonStatement", s:yellow, "", "") call X("pythonImport", s:red, "", "") " Go Highlighting call X("goStatement", s:purple, "", "") call X("goConditional", s:purple, "", "") call X("goRepeat", s:purple, "", "") call X("goException", s:purple, "", "") call X("goDeclaration", s:blue, "", "") call X("goConstants", s:yellow, "", "") call X("goBuiltins", s:orange, "", "") " CoffeeScript Highlighting call X("coffeeKeyword", s:purple, "", "") call X("coffeeConditional", s:blue, "", "") " JavaScript Highlighting call X("javaScriptBraces", s:foreground, "", "") call X("javaScriptFunction", s:red, "", "") call X("javaScriptConditional", s:purple, "", "") call X("javaScriptRepeat", s:purple, "", "") call X("javaScriptNumber", s:orange, "", "") call X("javaScriptMember", s:orange, "", "") call X("javaScriptGlobal", s:yellow, "", "") " for https://github.com/pangloss/vim-javascript call X("jsModules", s:red, "", "") call X("jsModuleWords", s:red, "", "") call X("jsFunction", s:red, "", "") call X("jsClass", s:yellow, "", "") call X("jsOperator", s:foreground, "", "") call X("jsOperatorWords", s:blue, "", "") call X("jsKeyword", s:blue, "", "") " HTML Highlighting call X("htmlTag", s:red,"","") call X("htmlTagName", s:red,"","") call X("htmlArg", s:red,"","") call X("htmlScriptTag", s:red,"","") " Shell/Bash highlighting call X("bashStatement", s:lightblue, "", "bold") call X("shDerefVar", s:aqua, "", "bold") call X("shDerefSimple", s:aqua, "", "") call X("shFunction", s:orange, "", "bold") call X("shStatement", s:lightblue, "", "") call X("shOperator", s:purple, "", "") call X("shConditional", s:orange, "", "") call X("shLoop", s:purple, "", "bold") call X("shQuote", s:olive, "", "") call X("shCaseEsac", s:aqua, "", "bold") call X("shSnglCase", s:purple, "", "none") call X("shFunctionOne", s:peach, "", "") call X("shCase", s:peach, "", "") call X("shSetList", s:peach, "", "") " Diff Highlighting let s:diffbackground = "494e56" call X("diffAdded", s:green, "", "") call X("diffRemoved", s:red, "", "") call X("DiffAdd", s:green, s:diffbackground, "") call X("DiffDelete", s:red, s:diffbackground, "") call X("DiffChange", s:yellow, s:diffbackground, "") call X("DiffText", s:diffbackground, s:orange, "") " ShowMarks Highlighting call X("ShowMarksHLl", s:orange, s:background, "none") call X("ShowMarksHLo", s:purple, s:background, "none") call X("ShowMarksHLu", s:yellow, s:background, "none") call X("ShowMarksHLm", s:aqua, s:background, "none") " Delete Functions delf X delf rgb delf colour delf rgb_colour delf rgb_level delf rgb_number delf grey_colour delf grey_level delf grey_number endif