From 599da06a2f823a972faecba0451e0fa4a07091b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Iser?= Date: Sat, 25 Feb 2017 18:00:08 +0100 Subject: [PATCH] Init --- LICENSE.md | 21 +++ README.md | 61 ++++++++ autoload/airline/themes/codedark.vim | 90 +++++++++++ colors/codedark.vim | 218 +++++++++++++++++++++++++++ 4 files changed, 390 insertions(+) create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 autoload/airline/themes/codedark.vim create mode 100644 colors/codedark.vim diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..70570c0 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Tomáš Iser + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..44c3ac8 --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +# vim-code-dark +`vim-code-dark` is a dark **color scheme for [Vim](http://www.vim.org/)** heavily inspired by the look of the Dark+ scheme of [Visual Studio Code](https://code.visualstudio.com/). While many of the colors are same, there are additional colors for specific usage or reserved for future use. The scheme also defines specific GUI colors (e.g. popup menu) and fully supports [`vim-airline`](https://github.com/vim-airline/vim-airline). + +## Screenshots + +![Screenshots](https://cloud.githubusercontent.com/assets/10374559/23332907/f524012a-fb81-11e6-8386-cda654d33ccd.png) + +## Color Palette + +![Color Palette](https://cloud.githubusercontent.com/assets/10374559/23146186/d005f732-f7d4-11e6-89fe-c27b0347702e.png) + +## Questions & Answers + +### How to install? +Simply as all other Vim plugins following the standard procedure of your plugin manager / manually. +* [Vundle](https://github.com/gmarik/vundle) + * `Plugin 'tomasiser/vim-code-dark'` +* [vim-plug](https://github.com/junegunn/vim-plug) + * `Plug 'tomasiser/vim-code-dark'` +* manual + * copy all of the files to `~/.vim` (or `$HOME\vimfiles` on Windows) directory + +### How to activate? +You can add the following line to your `.vimrc`: + +``` +colorscheme codedark +``` + +If you have [`vim-airline`](https://github.com/vim-airline/vim-airline), you can also use the provided theme: + +``` +let g:airline_theme = 'codedark' +``` + +### What is and how to enable the conservative mode? +If you don't like many colors and prefer the **conservative style of the standard Visual Studio**, you can try the conservative mode with reduced number of colors. To enable it, put the following line to your `.vimrc` *before* setting the scheme, like so: + +``` +let g:codedark_conservative = 1 +colorscheme codedark +``` + +### Why does file syntax not look like in Visual Studio Code? +Because Vim uses different syntax rules for files and this is just a colorscheme. + +### Are terminal colors supported? +Unfortunately terminals are **not supported** yet, see [#2](https://github.com/tomasiser/vim-code-dark/issues/2) and feel free to send a pull request. + +### My favourite language XYZ has wrong colors! +There are a lot of syntax definitions with different highlight groups. Feel free to send a pull request with additional highlight groups. + +### What setup can I see on the screenshots? +Screenshots come from gVim on Windows with the following font options and [`vim-airline`](https://github.com/vim-airline/vim-airline) enabled. + +``` +set enc=utf-8 +set guifont=Powerline_Consolas:h11 +set renderoptions=type:directx,gamma:1.5,contrast:0.5,geom:1,renmode:5,taamode:1,level:0.5 +``` + diff --git a/autoload/airline/themes/codedark.vim b/autoload/airline/themes/codedark.vim new file mode 100644 index 0000000..84fbe05 --- /dev/null +++ b/autoload/airline/themes/codedark.vim @@ -0,0 +1,90 @@ +" Vim Code Dark (airline theme) +" https://github.com/tomasiser/vim-code-dark + +scriptencoding utf-8 + +let g:airline#themes#codedark#palette = {} + +let s:cdFront = {'gui': '#FFFFFF', 'cterm': '00'} +let s:cdFrontGray = {'gui': '#D4D4D4', 'cterm': '00'} +let s:cdBack = {'gui': '#1E1E1E', 'cterm': '00'} +let s:cdSelection = {'gui': '#264F78', 'cterm': '00'} + +let s:cdPurple = {'gui': '#682279', 'cterm': '00'} +let s:cdBlue = {'gui': '#0A7ACA', 'cterm': '00'} +let s:cdLightBlue = {'gui': '#5cb6f8', 'cterm': '00'} +let s:cdDarkBlue = {'gui': '#11639B', 'cterm': '00'} +let s:cdOrange = {'gui': '#CE9178', 'cterm': '00'} +let s:cdYellow = {'gui': '#FFAF00', 'cterm': '00'} +let s:cdRed = {'gui': '#F44747', 'cterm': '00'} + +let s:cdDarkDarkDark = {'gui': '#262626', 'cterm': '00'} +let s:cdDarkDark = {'gui': '#303030', 'cterm': '00'} +let s:cdDark = {'gui': '#3C3C3C', 'cterm': '00'} + +let s:Warning = [ s:cdRed.gui, s:cdDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none'] + +" Normal: + +let s:N1 = [ s:cdFront.gui, s:cdBlue.gui, s:cdFront.cterm, s:cdBlue.cterm, 'none' ] +let s:N2 = [ s:cdFront.gui, s:cdDarkDark.gui, s:cdFront.cterm, s:cdDarkDark.cterm, 'none' ] +let s:N3 = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none' ] +let s:NM = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none'] + +let g:airline#themes#codedark#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) +let g:airline#themes#codedark#palette.normal_modified = { 'airline_c': s:NM } +let g:airline#themes#codedark#palette.normal.airline_warning = s:Warning +let g:airline#themes#codedark#palette.normal_modified.airline_warning = s:Warning + +" Insert: + +let s:I1 = [ s:cdBack.gui, s:cdYellow.gui, s:cdBack.cterm, s:cdYellow.cterm, 'none' ] +let s:I2 = [ s:cdFront.gui, s:cdDarkDark.gui, s:cdFront.cterm, s:cdDarkDark.cterm, 'none' ] +let s:I3 = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none' ] +let s:IM = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none'] + +let g:airline#themes#codedark#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) +let g:airline#themes#codedark#palette.insert_modified = { 'airline_c': s:IM } +let g:airline#themes#codedark#palette.insert.airline_warning = s:Warning +let g:airline#themes#codedark#palette.insert_modified.airline_warning = s:Warning + +" Replace: + +let s:R1 = [ s:cdBack.gui, s:cdYellow.gui, s:cdBack.cterm, s:cdYellow.cterm, 'none' ] +let s:R2 = [ s:cdFront.gui, s:cdDarkDark.gui, s:cdFront.cterm, s:cdDarkDark.cterm, 'none' ] +let s:R3 = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none' ] +let s:RM = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none'] + +let g:airline#themes#codedark#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) +let g:airline#themes#codedark#palette.replace_modified = { 'airline_c': s:RM } +let g:airline#themes#codedark#palette.replace.airline_warning = s:Warning +let g:airline#themes#codedark#palette.replace_modified.airline_warning = s:Warning + +" Visual: + +let s:V1 = [ s:cdLightBlue.gui, s:cdDark.gui, s:cdFront.cterm, s:cdPurple.cterm, 'none' ] +let s:V2 = [ s:cdFront.gui, s:cdDarkDark.gui, s:cdFront.cterm, s:cdDarkDark.cterm, 'none' ] +let s:V3 = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none' ] +let s:VM = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none'] + +let g:airline#themes#codedark#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) +let g:airline#themes#codedark#palette.visual_modified = { 'airline_c': s:VM } +let g:airline#themes#codedark#palette.visual.airline_warning = s:Warning +let g:airline#themes#codedark#palette.visual_modified.airline_warning = s:Warning + +" Inactive: + +let s:IA1 = [ s:cdFrontGray.gui, s:cdDark.gui, s:cdFrontGray.cterm, s:cdDark.cterm, 'none' ] +let s:IA2 = [ s:cdFrontGray.gui, s:cdDarkDark.gui, s:cdFrontGray.cterm, s:cdDarkDark.cterm, 'none' ] +let s:IA3 = [ s:cdFrontGray.gui, s:cdDarkDarkDark.gui, s:cdFrontGray.cterm, s:cdDarkDarkDark.cterm, 'none' ] +let s:IAM = [ s:cdFrontGray.gui, s:cdDarkDarkDark.gui, s:cdFrontGray.cterm, s:cdDarkDarkDark.cterm, 'none' ] + +let g:airline#themes#codedark#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3) +let g:airline#themes#codedark#palette.inactive_modified = { 'airline_c': s:IAM } + +" Red accent for readonly: + +let g:airline#themes#codedark#palette.accents = { + \ 'red': [ s:cdRed.gui, '', s:cdRed.cterm, '' ] + \ } + diff --git a/colors/codedark.vim b/colors/codedark.vim new file mode 100644 index 0000000..1ef3a05 --- /dev/null +++ b/colors/codedark.vim @@ -0,0 +1,218 @@ +" Vim Code Dark (color scheme) +" https://github.com/tomasiser/vim-code-dark + +scriptencoding utf-8 + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="codedark" + +" Highlighting function (inspiration from https://github.com/chriskempson/base16-vim) +fun! hi(group, fg, bg, attr, sp) + if !empty(a:fg) + exec "hi " . a:group . " guifg=" . a:fg.gui . " ctermfg=" . a:fg.cterm + endif + if !empty(a:bg) + exec "hi " . a:group . " guibg=" . a:bg.gui . " ctermbg=" . a:bg.cterm + endif + if a:attr != "" + exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr + endif + if !empty(a:sp) + exec "hi " . a:group . " guisp=" . a:sp.gui + endif +endfun + +" ------------------ +" Color definitions: +" ------------------ + +" General appearance colors: +" (some of them may be unused) + +let s:cdNone = {'gui': 'NONE', 'cterm': 'NONE'} +let s:cdFront = {'gui': '#D4D4D4', 'cterm': '00'} +let s:cdBack = {'gui': '#1E1E1E', 'cterm': '00'} + +let s:cdTabCurrent = {'gui': '#1E1E1E', 'cterm': '00'} +let s:cdTabOther = {'gui': '#2D2D2D', 'cterm': '00'} +let s:cdTabOutside = {'gui': '#252526', 'cterm': '00'} + +let s:cdLeftDark = {'gui': '#252526', 'cterm': '00'} +let s:cdLeftMid = {'gui': '#373737', 'cterm': '00'} +let s:cdLeftLight = {'gui': '#3F3F46', 'cterm': '00'} + +let s:cdPopupFront = {'gui': '#BBBBBB', 'cterm': '00'} +let s:cdPopupBack = {'gui': '#2D2D30', 'cterm': '00'} +let s:cdPopupHighlightBlue = {'gui': '#073655', 'cterm': '00'} +let s:cdPopupHighlightGray = {'gui': '#3D3D40', 'cterm': '00'} + +let s:cdSplitLight = {'gui': '#898989', 'cterm': '00'} +let s:cdSplitDark = {'gui': '#444444', 'cterm': '00'} +let s:cdSplitThumb = {'gui': '#424242', 'cterm': '00'} + +let s:cdCursorDarkDark = {'gui': '#222222', 'cterm': '00'} +let s:cdCursorDark = {'gui': '#51504F', 'cterm': '00'} +let s:cdCursorLight = {'gui': '#AEAFAD', 'cterm': '00'} +let s:cdSelection = {'gui': '#264F78', 'cterm': '00'} +let s:cdLineNumber = {'gui': '#5A5A5A', 'cterm': '00'} + +let s:cdDiffRedDark = {'gui': '#4B1818', 'cterm': '00'} +let s:cdDiffRedLight = {'gui': '#6F1313', 'cterm': '00'} +let s:cdDiffRedLightLight = {'gui': '#FB0101', 'cterm': '00'} +let s:cdDiffGreenDark = {'gui': '#373D29', 'cterm': '00'} +let s:cdDiffGreenLight = {'gui': '#4B5632', 'cterm': '00'} + +let s:cdSearchCurrent = {'gui': '#49545F', 'cterm': '00'} +let s:cdSearch = {'gui': '#4C4E50', 'cterm': '00'} + +" Syntax colors: + +if !exists("g:codedark_conservative") + let g:codedark_conservative=0 +endif + +let s:cdGray = {'gui': '#808080', 'cterm': '00'} +let s:cdViolet = {'gui': '#646695', 'cterm': '00'} +let s:cdBlue = {'gui': '#569CD6', 'cterm': '00'} +let s:cdLightBlue = {'gui': '#9CDCFE', 'cterm': '00'} +if g:codedark_conservative | let s:cdLightBlue = s:cdFront | endif +let s:cdGreen = {'gui': '#608B4E', 'cterm': '00'} +let s:cdBlueGreen = {'gui': '#4EC9B0', 'cterm': '00'} +let s:cdLightGreen = {'gui': '#B5CEA8', 'cterm': '00'} +let s:cdRed = {'gui': '#F44747', 'cterm': '00'} +let s:cdOrange = {'gui': '#CE9178', 'cterm': '00'} +let s:cdLightRed = {'gui': '#D16969', 'cterm': '00'} +if g:codedark_conservative | let s:cdLightRed = s:cdOrange | endif +let s:cdYellowOrange = {'gui': '#D7BA7D', 'cterm': '00'} +let s:cdYellow = {'gui': '#DCDCAA', 'cterm': '00'} +if g:codedark_conservative | let s:cdYellow = s:cdFront | endif +let s:cdPink = {'gui': '#C586C0', 'cterm': '00'} +if g:codedark_conservative | let s:cdPink = s:cdBlue | endif + +" Vim editor colors +" hi(GROUP, FOREGROUND, BACKGROUND, ATTRIBUTE, SPECIAL) +call hi('Normal', s:cdFront, s:cdBack, 'none', {}) +call hi('ColorColumn', {}, s:cdCursorDarkDark, 'none', {}) +call hi('Cursor', s:cdCursorDark, s:cdCursorLight, 'none', {}) +call hi('CursorLine', {}, s:cdCursorDarkDark, 'none', {}) +call hi('Directory', s:cdBlue, s:cdBack, 'none', {}) +call hi('DiffAdd', {}, s:cdDiffGreenDark, 'none', {}) +call hi('DiffChange', {}, s:cdDiffRedDark, 'none', {}) +call hi('DiffDelete', {}, s:cdDiffRedLight, 'none', {}) +call hi('DiffText', {}, s:cdDiffRedLight, 'none', {}) +call hi('EndOfBuffer', s:cdLineNumber, s:cdBack, 'none', {}) +call hi('ErrorMsg', s:cdRed, s:cdBack, 'none', {}) +call hi('VertSplit', s:cdSplitDark, s:cdBack, 'none', {}) +call hi('Folded', s:cdLeftLight, s:cdLeftDark, 'underline', {}) +call hi('FoldColumn', s:cdLineNumber, s:cdBack, 'none', {}) +call hi('SignColumn', {}, s:cdBack, 'none', {}) +call hi('IncSearch', s:cdNone, s:cdSearchCurrent, 'none', {}) +call hi('LineNr', s:cdLineNumber, s:cdBack, 'none', {}) +call hi('CursorLineNr', s:cdPopupFront, s:cdBack, 'none', {}) +call hi('MatchParen', s:cdNone, s:cdNone, 'inverse', {}) +call hi('ModeMsg', s:cdFront, s:cdLeftDark, 'none', {}) +call hi('MoreMsg', s:cdFront, s:cdLeftDark, 'none', {}) +call hi('NonText', {}, s:cdLeftDark, 'none', {}) +call hi('Pmenu', s:cdPopupFront, s:cdPopupBack, 'none', {}) +call hi('PmenuSel', s:cdPopupFront, s:cdPopupHighlightBlue, 'none', {}) +call hi('PmenuSbar', {}, s:cdPopupHighlightGray, 'none', {}) +call hi('PmenuThumb', {}, s:cdPopupFront, 'none', {}) +call hi('Question', s:cdBlue, s:cdBack, 'none', {}) +call hi('Search', s:cdNone, s:cdSearch, 'none', {}) +call hi('SpecialKey', s:cdBlue, s:cdNone, 'none', {}) +"call hi('Spell***', s:cdNone, s:cdSearch, 'none', {}) +call hi('StatusLine', s:cdFront, s:cdLeftMid, 'none', {}) +call hi('StatusLineNC', s:cdFront, s:cdLeftDark, 'none', {}) +call hi('TabLine', s:cdFront, s:cdTabOther, 'none', {}) +call hi('TabLineFill', s:cdFront, s:cdTabOutside, 'none', {}) +call hi('TabLineSel', s:cdFront, s:cdTabCurrent, 'none', {}) +call hi('Title', s:cdNone, s:cdNone, 'bold', {}) +call hi('Visual', s:cdNone, s:cdSelection, 'none', {}) +call hi('VisualNOS', s:cdNone, s:cdSelection, 'none', {}) +call hi('WarningMsg', s:cdOrange, s:cdBack, 'none', {}) +call hi('WildMenu', s:cdNone, s:cdSelection, 'none', {}) + +call hi('Comment', s:cdGreen, {}, 'none', {}) + +call hi('Constant', s:cdBlue, {}, 'none', {}) +call hi('String', s:cdOrange, {}, 'none', {}) +call hi('Character', s:cdOrange, {}, 'none', {}) +call hi('Number', s:cdLightGreen, {}, 'none', {}) +call hi('Boolean', s:cdBlue, {}, 'none', {}) +call hi('Float', s:cdLightGreen, {}, 'none', {}) + +call hi('Identifier', s:cdLightBlue, {}, 'none', {}) +call hi('Function', s:cdYellow, {}, 'none', {}) + +call hi('Statement', s:cdPink, {}, 'none', {}) +call hi('Conditional', s:cdPink, {}, 'none', {}) +call hi('Repeat', s:cdPink, {}, 'none', {}) +call hi('Label', s:cdPink, {}, 'none', {}) +call hi('Operator', s:cdFront, {}, 'none', {}) +call hi('Keyword', s:cdPink, {}, 'none', {}) +call hi('Exception', s:cdPink, {}, 'none', {}) + +call hi('PreProc', s:cdPink, {}, 'none', {}) +call hi('Include', s:cdPink, {}, 'none', {}) +call hi('Define', s:cdPink, {}, 'none', {}) +call hi('Macro', s:cdPink, {}, 'none', {}) +call hi('PreCondit', s:cdPink, {}, 'none', {}) + +call hi('Type', s:cdBlue, {}, 'none', {}) +call hi('StorageClass', s:cdBlue, {}, 'none', {}) +call hi('Structure', s:cdBlue, {}, 'none', {}) +call hi('Typedef', s:cdBlue, {}, 'none', {}) + +call hi('Special', s:cdFront, {}, 'none', {}) +call hi('SpecialChar', s:cdFront, {}, 'none', {}) +call hi('Tag', s:cdFront, {}, 'none', {}) +call hi('Delimiter', s:cdFront, {}, 'none', {}) +call hi('SpecialComment', s:cdFront, {}, 'none', {}) +call hi('Debug', s:cdFront, {}, 'none', {}) + +call hi('Underlined', s:cdNone, {}, 'underline', {}) + +call hi('Ignore', s:cdFront, {}, 'none', {}) + +call hi('Error', s:cdNone, s:cdNone, 'undercurl', s:cdRed) + +call hi('Todo', s:cdNone, s:cdLeftMid, 'none', {}) + +" HTML: +call hi('htmlTag', s:cdGray, {}, 'none', {}) +call hi('htmlEndTag', s:cdGray, {}, 'none', {}) +call hi('htmlTagName', s:cdBlue, {}, 'none', {}) +call hi('htmlSpecialTagName', s:cdBlue, {}, 'none', {}) +call hi('htmlArg', s:cdLightBlue, {}, 'none', {}) + +" CSS: +call hi('cssBraces', s:cdFront, {}, 'none', {}) +call hi('cssInclude', s:cdPink, {}, 'none', {}) +call hi('cssTagName', s:cdYellowOrange, {}, 'none', {}) +call hi('cssClassName', s:cdYellowOrange, {}, 'none', {}) +call hi('cssPseudoClass', s:cdYellowOrange, {}, 'none', {}) +call hi('cssPseudoClassId', s:cdYellowOrange, {}, 'none', {}) +call hi('cssPseudoClassLang', s:cdYellowOrange, {}, 'none', {}) +call hi('cssIdentifier', s:cdYellowOrange, {}, 'none', {}) +call hi('cssProp', s:cdLightBlue, {}, 'none', {}) +call hi('cssDefinition', s:cdLightBlue, {}, 'none', {}) +call hi('cssAttr', s:cdOrange, {}, 'none', {}) +call hi('cssAttrRegion', s:cdOrange, {}, 'none', {}) +call hi('cssColor', s:cdOrange, {}, 'none', {}) +call hi('cssFunction', s:cdOrange, {}, 'none', {}) +call hi('cssFunctionName', s:cdOrange, {}, 'none', {}) +call hi('cssVendor', s:cdOrange, {}, 'none', {}) +call hi('cssValueNumber', s:cdOrange, {}, 'none', {}) +call hi('cssValueLength', s:cdOrange, {}, 'none', {}) +call hi('cssUnitDecorators', s:cdOrange, {}, 'none', {}) + +" JavaScript: +call hi('jsVariableDef', s:cdLightBlue, {}, 'none', {}) +call hi('jsFuncArgs', s:cdLightBlue, {}, 'none', {}) +call hi('jsRegexpString', s:cdLightRed, {}, 'none', {}) +call hi('jsThis', s:cdBlue, {}, 'none', {}) +