Skip to content

Commit 41fcda4

Browse files
committed
First commit
0 parents  commit 41fcda4

File tree

10 files changed

+974
-0
lines changed

10 files changed

+974
-0
lines changed

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Tomáš Iser
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# vim-code-dark
2+
`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).
3+
4+
**:exclamation: To install and enable this colorscheme, [read installation instructions](#installation).**
5+
6+
*This colorscheme does also support 256 and 8/16 color terminals. See [installation instructions](#installation) step 3.*
7+
8+
## Screenshots
9+
10+
### gVim / modern terminals
11+
![Ruby and NERDTree](https://cloud.githubusercontent.com/assets/10374559/23333137/b86efaa0-fb86-11e6-8c06-813f81c1f9bb.png)
12+
![Editing HTML and CSS](https://cloud.githubusercontent.com/assets/10374559/23344709/459972a2-fc81-11e6-9b50-c432d998caef.png)
13+
14+
*Code samples [1](http://sandbox.mc.edu/~bennet/ruby/code/), [2](https://tmtheme-editor.herokuapp.com/), [`nerdtree`](https://github.com/scrooloose/nerdtree)*
15+
16+
### Terminals with limited color support
17+
18+
#### Fixed 256 colors
19+
![Terminal on Debian with 256 colors](https://cloud.githubusercontent.com/assets/10374559/23342967/e61e28c6-fc63-11e6-9ccf-d6189b9e1b61.png)
20+
21+
#### Fixed 8/16 colors
22+
![Terminal on Debian with 16 colors](https://cloud.githubusercontent.com/assets/10374559/23341713/0e8dd778-fc4d-11e6-8430-b11f161305d7.png)
23+
24+
## Color Palette
25+
26+
![Color Palette](https://cloud.githubusercontent.com/assets/10374559/23341312/1961f416-fc45-11e6-83ba-d7180c5fdd6d.png)
27+
28+
## Installation
29+
30+
### 1) Download
31+
32+
Simply as any other Vim plugins: download manually or follow the standard procedure of your plugin manager:
33+
* [Vundle](https://github.com/gmarik/vundle)
34+
```
35+
Plugin 'tomasiser/vim-code-dark'
36+
```
37+
* [vim-plug](https://github.com/junegunn/vim-plug)
38+
```
39+
Plug 'tomasiser/vim-code-dark'
40+
```
41+
* manual
42+
43+
copy all of the files to `~/.vim` (or `$HOME\vimfiles` on Windows) directory
44+
45+
### 2) Enable in `.vimrc`
46+
47+
Add the following line to your `.vimrc`:
48+
49+
```
50+
colorscheme codedark
51+
```
52+
53+
If you have [`vim-airline`](https://github.com/vim-airline/vim-airline), you can also enable the provided theme:
54+
55+
```
56+
let g:airline_theme = 'codedark'
57+
```
58+
59+
### 3) Terminal support
60+
61+
#### 3.1) If you use gVim / a modern terminal
62+
:+1: The colorscheme will work out of the box. No need to setup anything else!
63+
64+
#### 3.2) If the colors seem to be wrong
65+
If your terminal supports 256 colors (see [this script](http://www.robmeerman.co.uk/unix/256colours) if you want to test your terminal), you **may need to set `t_Co` to 256** and [possibly also reset the `t_ut` value](http://vi.stackexchange.com/questions/238/tmux-is-changing-part-of-the-background-in-vim) in your `.vimrc` before setting the colorscheme:
66+
67+
```
68+
set t_Co=256
69+
set t_ut=
70+
colorscheme codedark
71+
```
72+
73+
(Additionally, if you don't want to or cannot use `t_Co`, you can `let g:codedark_term256=1`.)
74+
75+
#### 3.3) If your terminal only supports 8/16 colors
76+
77+
:exclamation: Before following those steps, first try step 3.2) - maybe your terminal does support 256 colors!
78+
79+
If your terminal does not support 256 colors, you may want to change your terminal colors:
80+
81+
##### 3.3.1) Some Unix terminals
82+
Clone [`base16-shell`](https://github.com/chriskempson/base16-shell/) into `~/.config/base16-shell`:
83+
84+
```
85+
git clone https://github.com/chriskempson/base16-shell.git ~/.config/base16-shell
86+
```
87+
88+
Then copy a script from this (`vim-code-dark`) repository (`base16/templates/shell/scripts/base16-codedark.sh`) into `~/.config/base16-shell/scripts`.
89+
90+
Following the instructions from [`base16-shell`](https://github.com/chriskempson/base16-shell/), you should now modify your `~/.bashrc` or `~/.zshrc` (depending on your shell) and insert the following lines:
91+
92+
```
93+
BASE16_SHELL=$HOME/.config/base16-shell/
94+
[ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)"
95+
```
96+
97+
Now start a new shell and type the following command: `base16_codedark`.
98+
99+
You should now be able to use Vim with your new colorscheme.
100+
101+
##### 3.3.2) iTerm2
102+
iTerm2 should actually support 256 colors, try setting `Report Terminal Type` to `xterm-256color` and follow step 3.2). If it does not work, you can manually modify your terminal colors in settings (`CMD+i`, Colors tab) following the [color palette picture](#color-palette). You will have to choose which color to use as red, blue etc. according to your personal preferences.
103+
104+
##### 3.3.3) PuTTY
105+
PuTTY should actually support 256 colors, try following [steps on StackOverflow](http://superuser.com/questions/436910/emulate-256-colors-in-putty-terminal). If it does not work, run `base16/templates/putty/putty/base16-codedark.reg` to modify your registry, then run PuTTY and load `codedark` in the session list. This will modify your PuTTY terminal colors.
106+
107+
## FAQ
108+
109+
### The background color in my terminal is wrong when there is no text!
110+
Try resetting the `t_ut` value in your `.vimrc` as [described here](http://vi.stackexchange.com/questions/238/tmux-is-changing-part-of-the-background-in-vim):
111+
```
112+
set t_Co=256
113+
set t_ut=
114+
colorscheme codedark
115+
```
116+
117+
### What is and how to enable the conservative mode?
118+
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:
119+
120+
```
121+
let g:codedark_conservative = 1
122+
colorscheme codedark
123+
```
124+
125+
### Something is broken but I know how to fix it!
126+
Pull requests are welcome! Feel free to send one with an explanation!
127+
128+
### Why does file syntax not look exactly like in Visual Studio Code?
129+
Because Vim uses different syntax rules. This is just a colorscheme for vim, not a syntax definition.
130+
131+
### My favourite language has wrong / bad / awful colors!
132+
There are a lot of syntax definitions with different highlight groups. Feel free to send a pull request with additional highlight groups!
133+
134+
### What setup can I see on the first screenshots?
135+
Screenshots come from gVim on Windows with the following font options and [`vim-airline`](https://github.com/vim-airline/vim-airline) enabled.
136+
137+
```
138+
set enc=utf-8
139+
set guifont=Powerline_Consolas:h11
140+
set renderoptions=type:directx,gamma:1.5,contrast:0.5,geom:1,renmode:5,taamode:1,level:0.5
141+
```
142+

autoload/airline/themes/codedark.vim

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
" Vim Code Dark (airline theme)
2+
" https://github.com/tomasiser/vim-code-dark
3+
4+
scriptencoding utf-8
5+
6+
let g:airline#themes#codedark#palette = {}
7+
8+
" Terminal colors (base16):
9+
let s:cterm00 = "00"
10+
let s:cterm03 = "08"
11+
let s:cterm05 = "07"
12+
let s:cterm07 = "15"
13+
let s:cterm08 = "01"
14+
let s:cterm0A = "03"
15+
let s:cterm0B = "02"
16+
let s:cterm0C = "06"
17+
let s:cterm0D = "04"
18+
let s:cterm0E = "05"
19+
if exists('base16colorspace') && base16colorspace == "256"
20+
let s:cterm01 = "18"
21+
let s:cterm02 = "19"
22+
let s:cterm04 = "20"
23+
let s:cterm06 = "21"
24+
let s:cterm09 = "16"
25+
let s:cterm0F = "17"
26+
else
27+
let s:cterm01 = "00"
28+
let s:cterm02 = "08"
29+
let s:cterm04 = "07"
30+
let s:cterm06 = "07"
31+
let s:cterm09 = "06"
32+
let s:cterm0F = "03"
33+
endif
34+
35+
if &t_Co >= 256
36+
let g:codedark_term256=1
37+
elseif !exists("g:codedark_term256")
38+
let g:codedark_term256=0
39+
endif
40+
41+
let s:cdFront = {'gui': '#FFFFFF', 'cterm': (g:codedark_term256 ? '15' : s:cterm07)}
42+
let s:cdFrontGray = {'gui': '#D4D4D4', 'cterm': (g:codedark_term256 ? '188' : s:cterm05)}
43+
let s:cdBack = {'gui': '#1E1E1E', 'cterm': (g:codedark_term256 ? '234' : s:cterm00)}
44+
let s:cdSelection = {'gui': '#264F78', 'cterm': (g:codedark_term256 ? '24' : s:cterm01)}
45+
46+
let s:cdBlue = {'gui': '#0A7ACA', 'cterm': (g:codedark_term256 ? '32' : s:cterm0D)}
47+
let s:cdLightBlue = {'gui': '#5CB6F8', 'cterm': (g:codedark_term256 ? '75' : s:cterm0C)}
48+
let s:cdYellow = {'gui': '#FFAF00', 'cterm': (g:codedark_term256 ? '214' : s:cterm0A)}
49+
let s:cdRed = {'gui': '#F44747', 'cterm': (g:codedark_term256 ? '203' : s:cterm08)}
50+
51+
let s:cdDarkDarkDark = {'gui': '#262626', 'cterm': (g:codedark_term256 ? '235' : s:cterm01)}
52+
let s:cdDarkDark = {'gui': '#303030', 'cterm': (g:codedark_term256 ? '236' : s:cterm02)}
53+
let s:cdDark = {'gui': '#3C3C3C', 'cterm': (g:codedark_term256 ? '237' : s:cterm03)}
54+
55+
let s:Warning = [ s:cdRed.gui, s:cdDarkDark.gui, s:cdRed.cterm, s:cdDarkDark.cterm, 'none']
56+
57+
" Normal:
58+
59+
let s:N1 = [ s:cdFront.gui, s:cdBlue.gui, s:cdFront.cterm, s:cdBlue.cterm, 'none' ]
60+
let s:N2 = [ s:cdFront.gui, s:cdDarkDark.gui, s:cdFront.cterm, s:cdDarkDark.cterm, 'none' ]
61+
let s:N3 = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none' ]
62+
let s:NM = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none']
63+
64+
let g:airline#themes#codedark#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
65+
let g:airline#themes#codedark#palette.normal_modified = { 'airline_c': s:NM }
66+
let g:airline#themes#codedark#palette.normal.airline_warning = s:Warning
67+
let g:airline#themes#codedark#palette.normal_modified.airline_warning = s:Warning
68+
69+
" Insert:
70+
71+
let s:I1 = [ s:cdBack.gui, s:cdYellow.gui, s:cdBack.cterm, s:cdYellow.cterm, 'none' ]
72+
let s:I2 = [ s:cdFront.gui, s:cdDarkDark.gui, s:cdFront.cterm, s:cdDarkDark.cterm, 'none' ]
73+
let s:I3 = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none' ]
74+
let s:IM = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none']
75+
76+
let g:airline#themes#codedark#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
77+
let g:airline#themes#codedark#palette.insert_modified = { 'airline_c': s:IM }
78+
let g:airline#themes#codedark#palette.insert.airline_warning = s:Warning
79+
let g:airline#themes#codedark#palette.insert_modified.airline_warning = s:Warning
80+
81+
" Replace:
82+
83+
let s:R1 = [ s:cdBack.gui, s:cdYellow.gui, s:cdBack.cterm, s:cdYellow.cterm, 'none' ]
84+
let s:R2 = [ s:cdFront.gui, s:cdDarkDark.gui, s:cdFront.cterm, s:cdDarkDark.cterm, 'none' ]
85+
let s:R3 = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none' ]
86+
let s:RM = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none']
87+
88+
let g:airline#themes#codedark#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
89+
let g:airline#themes#codedark#palette.replace_modified = { 'airline_c': s:RM }
90+
let g:airline#themes#codedark#palette.replace.airline_warning = s:Warning
91+
let g:airline#themes#codedark#palette.replace_modified.airline_warning = s:Warning
92+
93+
" Visual:
94+
95+
let s:V1 = [ s:cdLightBlue.gui, s:cdDark.gui, s:cdLightBlue.cterm, s:cdDark.cterm, 'none' ]
96+
let s:V2 = [ s:cdFront.gui, s:cdDarkDark.gui, s:cdFront.cterm, s:cdDarkDark.cterm, 'none' ]
97+
let s:V3 = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none' ]
98+
let s:VM = [ s:cdFront.gui, s:cdDarkDarkDark.gui, s:cdFront.cterm, s:cdDarkDarkDark.cterm, 'none']
99+
100+
let g:airline#themes#codedark#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
101+
let g:airline#themes#codedark#palette.visual_modified = { 'airline_c': s:VM }
102+
let g:airline#themes#codedark#palette.visual.airline_warning = s:Warning
103+
let g:airline#themes#codedark#palette.visual_modified.airline_warning = s:Warning
104+
105+
" Inactive:
106+
107+
let s:IA1 = [ s:cdFrontGray.gui, s:cdDark.gui, s:cdFrontGray.cterm, s:cdDark.cterm, 'none' ]
108+
let s:IA2 = [ s:cdFrontGray.gui, s:cdDarkDark.gui, s:cdFrontGray.cterm, s:cdDarkDark.cterm, 'none' ]
109+
let s:IA3 = [ s:cdFrontGray.gui, s:cdDarkDarkDark.gui, s:cdFrontGray.cterm, s:cdDarkDarkDark.cterm, 'none' ]
110+
let s:IAM = [ s:cdFrontGray.gui, s:cdDarkDarkDark.gui, s:cdFrontGray.cterm, s:cdDarkDarkDark.cterm, 'none' ]
111+
112+
let g:airline#themes#codedark#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
113+
let g:airline#themes#codedark#palette.inactive_modified = { 'airline_c': s:IAM }
114+
115+
" Red accent for readonly:
116+
117+
let g:airline#themes#codedark#palette.accents = {
118+
\ 'red': [ s:cdRed.gui, '', s:cdRed.cterm, '' ]
119+
\ }
120+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
" =============================================================================
2+
" Filename: autoload/lightline/colorscheme/codedark.vim
3+
" Author: artanikin
4+
" License: MIT License
5+
" Last Change: 2019/12/05 12:26:00
6+
" =============================================================================
7+
8+
let s:term_red = 204
9+
let s:term_green = 114
10+
let s:term_yellow = 180
11+
let s:term_blue = 39
12+
let s:term_purple = 170
13+
let s:term_white = 145
14+
let s:term_black = 235
15+
let s:term_grey = 236
16+
17+
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
18+
19+
let s:p.normal.left = [ [ '#262626', '#608B4E', s:term_black, s:term_green, 'bold' ], [ '#608B4E', '#262626', s:term_green, s:term_black ] ]
20+
let s:p.normal.right = [ [ '#262626', '#608B4E', s:term_black, s:term_green ], [ '#D4D4D4', '#3C3C3C', s:term_white, s:term_grey ], [ '#608B4E', '#262626', s:term_green, s:term_black ] ]
21+
let s:p.inactive.right = [ [ '#262626', '#569CD6', s:term_black, s:term_blue], [ '#D4D4D4', '#3C3C3C', s:term_white, s:term_grey ] ]
22+
let s:p.inactive.left = s:p.inactive.right[1:]
23+
" her
24+
let s:p.insert.left = [ [ '#262626', '#569CD6', s:term_black, s:term_blue, 'bold' ], [ '#569CD6', '#262626', s:term_blue, s:term_black ] ]
25+
let s:p.insert.right = [ [ '#262626', '#569CD6', s:term_black, s:term_blue ], [ '#D4D4D4', '#3C3C3C', s:term_white, s:term_grey ], [ '#569CD6', '#262626', s:term_blue, s:term_black ] ]
26+
let s:p.replace.left = [ [ '#262626', '#D16969', s:term_black, s:term_red, 'bold' ], [ '#D16969', '#262626', s:term_red, s:term_black ] ]
27+
let s:p.replace.right = [ [ '#262626', '#D16969', s:term_black, s:term_red, 'bold' ], s:p.normal.right[1], [ '#D16969', '#262626', s:term_red, s:term_black ] ]
28+
let s:p.visual.left = [ [ '#262626', '#C586C0', s:term_black, s:term_purple, 'bold' ], [ '#C586C0', '#262626', s:term_purple, s:term_black ] ]
29+
let s:p.visual.right = [ [ '#262626', '#C586C0', s:term_black, s:term_purple, 'bold' ], s:p.normal.right[1], [ '#C586C0', '#262626', s:term_purple, s:term_black ] ]
30+
let s:p.normal.middle = [ [ '#D4D4D4', '#262626', s:term_white, s:term_black ] ]
31+
let s:p.insert.middle = s:p.normal.middle
32+
let s:p.replace.middle = s:p.normal.middle
33+
let s:p.tabline.left = [ s:p.normal.left[1] ]
34+
let s:p.tabline.tabsel = [ s:p.normal.left[0] ]
35+
let s:p.tabline.middle = s:p.normal.middle
36+
let s:p.tabline.right = [ s:p.normal.left[1] ]
37+
let s:p.normal.error = [ [ '#262626', '#D16969', s:term_black, s:term_red ] ]
38+
let s:p.normal.warning = [ [ '#262626', '#D7BA7D', s:term_black, s:term_yellow ] ]
39+
40+
let g:lightline#colorscheme#codedark#palette = lightline#colorscheme#fill(s:p)

base16/schemes/codedark/codedark.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
scheme: "codedark"
2+
author: "Tomas Iser (https://github.com/tomasiser)"
3+
base00: "1E1E1E"
4+
base01: "262626"
5+
base02: "303030"
6+
base03: "3C3C3C"
7+
base04: "808080"
8+
base05: "D4D4D4"
9+
base06: "E9E9E9"
10+
base07: "FFFFFF"
11+
base08: "D16969"
12+
base09: "B5CEA8"
13+
base0A: "D7BA7D"
14+
base0B: "608B4E"
15+
base0C: "9CDCFE"
16+
base0D: "569CD6"
17+
base0E: "C586C0"
18+
base0F: "CE9178"

0 commit comments

Comments
 (0)