diff --git a/vim/colors/campo-dark-blue.vim b/vim/colors/campo-dark-blue.vim index 28d6d9d..4854d27 100644 --- a/vim/colors/campo-dark-blue.vim +++ b/vim/colors/campo-dark-blue.vim @@ -19,11 +19,11 @@ if has('termguicolors') let s:green = "88b888" let s:red = "ef2929" - let s:text = "f1f1f1" + let s:text = "f1f1e8" let s:foreground = s:text - let s:background = "08363c" - let s:selection = "546e7a" + let s:background = "072730" + let s:selection = "546e8f" let s:window = "37474f" let s:line = "034a4a" let s:active_tab_bg = s:background @@ -37,27 +37,33 @@ if has('termguicolors') let s:error_msg_background = s:background let s:error_msg_foreground = "e40e0e" - let s:function_name = "0effdb" - let s:pre_processor = "a6f0e9" + let s:function_name = "0eefcb" + let s:pre_processor = s:text let s:define = "a5bce4" - let s:struct = "de90ea" - " things like 'return' - let s:statement = "ffffff" - let s:number = "ffffff" + let s:struct = "ae90ea" + let s:number = s:text + + " things like 'return', 'goto', 'case', 'break' + let s:statement = s:text + " this like 'inline' - let s:type = "ffffff" + let s:type = s:text + " #include let s:include = s:text - let s:string = s:text - let s:comment = "6df97e" - let s:constant = "90f0f7" - let s:c_type = s:pre_processor + let s:string = s:text + let s:comment = "5dea82" + + " true, false, etc + let s:constant = s:text + + let s:c_type = s:text let s:c_storage_class = s:text - let s:c_conditional = "ffffff" - let s:c_loops = "ffffff" + let s:c_conditional = s:text + let s:c_loops = s:text - let s:vim_command = "ffffff" + let s:vim_command = s:text else echoerr "This theme requires 'termguicolors' support!" diff --git a/vim/colors/campo-dark-greenish.vim b/vim/colors/campo-dark-greenish.vim new file mode 100644 index 0000000..264875a --- /dev/null +++ b/vim/colors/campo-dark-greenish.vim @@ -0,0 +1,480 @@ +" A simple dark vim colorscheme. +" Maintainer: Michael Campagnaro +" Version: 1.0 +" +" The theme file original copied from the Tomorrow theme. +" See https://github.com/chriskempson/vim-tomorrow-theme.git for it. +" Hex color conversion functions borrowed from the theme "Desert256". + +if has('termguicolors') + " Supports 24-bit color range + set termguicolors + let g:campo_theme_use_rainbow_parens = 0 + + let s:blue = "3699cc" + let s:purple = "ce93d8" + let s:grey = "b0bec5" + let s:orange = "ffb74d" + let s:yellow = "fff176" + let s:green = "88b888" + let s:red = "ef2929" + + let s:text = "f1f1f1" + + let s:foreground = s:text + let s:background = "08363c" + let s:selection = "546e7a" + let s:window = "37474f" + let s:line = "034a4a" + let s:active_tab_bg = s:background + let s:active_tab_fg = s:text + let s:inactive_tab_bg = s:line + let s:inactive_tab_fg = "dddddd" + let s:tab_line_bg = s:inactive_tab_bg + let s:bad_spelling = "ee877d" + let s:todo = "b8fbb0" + let s:bugs = "b8fbb0" + let s:error_msg_background = s:background + let s:error_msg_foreground = "e40e0e" + + let s:function_name = "0effdd" + let s:pre_processor = s:text + let s:define = "a5bce4" + let s:struct = "de90ea" + let s:number = s:text + + " things like 'return', 'goto', 'case', 'break' + let s:statement = s:text + + " this like 'inline' + let s:type = s:text + + " #include + let s:include = s:text + + let s:string = s:text + let s:comment = "6df97e" + + " true, false, etc + let s:constant = s:text + + let s:c_type = s:text + let s:c_storage_class = s:text + let s:c_conditional = s:text + let s:c_loops = s:text + + let s:vim_command = s:text + +else + echoerr "This theme requires 'termguicolors' support!" +endif + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "campo-dark-blue" + +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 + + " Vim Highlighting + call X("Normal", s:foreground, s:background, "") + call X("LineNr", s:grey, "", "") + call X("NonText", s:foreground, "", "") + call X("SpecialKey", s:blue, "", "") + call X("Search", s:foreground, s:selection, "") + call X("TabLineSel", s:active_tab_fg, s:active_tab_bg, "bold") + call X("TabLine", s:inactive_tab_fg, s:inactive_tab_bg, "none") + call X("TabLineFill", "", s:tab_line_bg, "none") + call X("StatusLine", s:window, s:foreground, "reverse") + call X("StatusLineNC", s:window, s:comment, "reverse") + call X("VertSplit", s:window, s:window, "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:comment, s:background, "") + if version >= 700 + call X("CursorLine", "", s:line, "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("Title", s:comment, "", "") + call X("Cursor", "", s:foreground, "") + call X("Identifier", s:grey, "", "none") + call X("Statement", s:statement, "", "") + call X("Conditional", s:foreground, "", "") + call X("Repeat", s:yellow, "", "") + call X("Structure", s:struct, "", "") + call X("Function", s:function_name, "", "") + call X("Constant", s:constant, "", "") + call X("String", s:string, "", "") + call X("Special", s:foreground, "", "") + call X("PreProc", s:pre_processor, "", "") + call X("Operator", s:foreground, "", "none") + call X("Type", s:type, "", "") + call X("Define", s:define, "", "none") + call X("Include", s:include, "", "") + call X("Number", s:number, "", "") + call X("SpellBad", s:bad_spelling, s:background, "underline,bold") + + " Custom TODO/NOTE colors + call X("Todo", s:todo, s:background, "underline") + call X("Bugs", s:bugs, s:background, "standout") + call X("Notes","ffffff",s:background,"standout") + call X("Notices","dcd53e",s:background,"bold") + call X("ErrorMsg", s:error_msg_foreground, s:error_msg_background, "bold") + + "call X("Ignore", "666666", "", "") + + " Vim Highlighting + call X("vimCommand", s:vim_command, "", "") + + " C Highlighting + call X("cType", s:c_type, "", "") + call X("cStorageClass", s:c_storage_class, "", "") + call X("cConditional", s:c_conditional, "", "") + call X("cRepeat", s:c_loops, "", "") + + " PHP Highlighting + call X("phpVarSelector", s:red, "", "") + call X("phpIdentifier", s:red, "", "") + call X("phpFCKeyword", s:purple, "", "") + call X("phpSCKeyword", s:purple, "", "") + call X("phpKeyword", s:purple, "", "") + call X("phpType", s:purple, "", "") + call X("phpRepeat", s:red, "", "") + call X("phpDefine", s:purple, "", "") + call X("phpDocTags", s:function_name, "", "") + call X("phpDocParam", s:green, "", "") + call X("phpFunction", s:blue, "", "") + call X("phpFunctions", s:blue, "", "") + call X("phpClass", s:blue, "", "") + call X("phpClasses", s:orange, "", "") + call X("phpMagicConstants", s:yellow, "", "") + call X("phpMemberSelector", s:grey, "", "") + + " Ruby Highlighting + call X("rubySymbol", s:green, "", "") + call X("rubyConstant", s:foreground, "", "") + 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:red, "", "") + call X("pythonStatement", s:blue, "", "") + call X("pythonConditional", s:purple, "", "") + call X("pythonRepeat", s:purple, "", "") + call X("pythonException", s:purple, "", "") + call X("pythonFunction", s:function_name, "", "") + call X("pythonSelf", s:grey, "", "") + call X("pythonOperator", s:purple, "", "") + call X("pythonExtraOperator", s:purple, "", "") + call X("pythonClass", s:function_name, "", "") + call X("pythonDecorator", s:orange, "", "") + call X("pythonDocstring", s:comment, "", "") + call X("pythonBuiltinObj", s:yellow, "", "") + call X("pythonBuiltinType", s:orange, "", "") + call X("pythonNumber", s:orange, "", "") + + " 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:purple, "", "") + call X("coffeeSpecialVar", s:orange, "", "") + call X("coffeeSpecialIdent", s:red, "", "") + call X("coffeeObject", s:orange, "", "") + call X("coffeeObjAssign", s:blue, "", "") + call X("coffeeArrow", s:purple, "", "") + call X("coffeeBoolean", s:foreground, "", "") + call X("coffeeGlobal", s:foreground, "", "") + call X("coffeeModuleKeyword", s:function_name, "", "") + call X("coffeeFuncCall", s:blue, "", "") + + " JavaScript Highlighting + call X("javaScriptBraces", s:foreground, "", "") + call X("javaScriptFunction", s:purple, "", "") + call X("javaScriptConditional", s:purple, "", "") + call X("javaScriptRepeat", s:purple, "", "") + call X("javaScriptNumber", s:orange, "", "") + call X("javaScriptMember", s:orange, "", "") + + " HTML Highlighting + call X("htmlTag", s:foreground, "", "") + call X("htmlTagName", s:foreground, "", "") + call X("htmlArg", s:foreground, "", "") + call X("htmlScriptTag", s:blue, "", "") + + " Blade Tempalte Highlight + call X("bladeDelimiter", s:orange, "", "") + call X("bladeKeyword", s:blue, "", "") + + " Diff Highlighting + call X("diffAdded", "", s:green, "none") + call X("diffRemoved", "", s:red, "none") + call X("diffChanged", "", s:yellow, "none") + call X("DiffAdd", s:window, s:green, "none") + call X("DiffDelete", s:window, s:red, "none") + call X("DiffChange", s:window, s:yellow, "none") + call X("DiffText", s:background, s:yellow, "none") + + call X("GitGutterAdd", s:green, "", "") + call X("GitGutterDelete", s:red, "", "") + call X("GitGutterChange", s:yellow, "", "") + call X("GitGutterChangeDelete", s:orange, "", "") + + call X("VimwikiHeader1", s:red, "", "") + call X("VimwikiHeader2", s:green, "", "") + call X("VimwikiHeader3", s:blue, "", "") + call X("VimwikiHeader4", s:function_name, "", "") + call X("VimwikiHeader5", s:orange, "", "") + call X("VimwikiHeader6", s:yellow, "", "") + + " YAML + call X("yamlBlockMappingKey", s:blue, "", "") + + " 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 diff --git a/vimrc b/vimrc index 4d9ac34..3ae6f99 100644 --- a/vimrc +++ b/vimrc @@ -366,7 +366,7 @@ augroup campoCmds " Automatically wrap at N characters. autocmd FileType gitcommit setlocal colorcolumn=72 - autocmd BufRead,BufNewFile *.{md,txt,plan} exec "setlocal textwidth=".g:campo_max_line_length + " @flagged for removal. It's a bit annoying. autocmd BufRead,BufNewFile *.{md,txt,plan} exec "setlocal textwidth=".g:campo_max_line_length " Spell checking. autocmd FileType gitcommit,markdown,text setlocal spell