Skip to content

Commit b185b44

Browse files
committed
Initial commit
0 parents  commit b185b44

File tree

3 files changed

+200
-0
lines changed

3 files changed

+200
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.swp

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Monokai Colorscheme for Vim
2+
3+
This is yet another Vim port of the TextMate's Monokai Colorscheme.
4+
5+
## Configuration
6+
7+
Not much to do, except that this colorscheme comes with a new highlighting
8+
group called Argument, which one can use to improve highlighting.
9+
10+
I personally use
11+
[vim-javascript-syntax](https://github.com/jelera/vim-javascript-syntax) and
12+
[vim-ruby](https://girhub.com/vim-ruby/vim-ruby), and use the following in my
13+
`vimrc` file:
14+
15+
```
16+
hi! link rubyBlockParameter Argument
17+
hi! link javaScriptFuncArg Argument
18+
```
19+
20+
Take that as an example. Not sure how it could be done so easily with Vim's
21+
default highlighting of JavaScript and Ruby, since I don't know if these
22+
syntax groups exist by default. Certainly one can find the proper syntax
23+
groups for other languages and do the same thing, or create them if not
24+
available.

colors/monokai.vim

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
" Name: Monokai Colorscheme for Vim.
2+
" Author: rcabralc <rcabralc@gmail.com>
3+
" URL: https://github.com/rcabralc/monokai.vim
4+
" Note: Colorscheme based on the original TextMate's Monokai theme by Wimer
5+
" Hazenberg, which can be found at
6+
" http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/).
7+
"
8+
" Technique based on Solarized by Ethan Schoonover
9+
" (https://github.com/altercation/vim-colors-solarized) and
10+
" vim-monokai by Marcin Kulik (https://github.com/sickill/vim-monokai).
11+
12+
" Palette
13+
let s:black = "#272822"
14+
let s:darkgray = "#49483e"
15+
let s:gray = "#5f5c4e" " Not found in original Monokai, mean between previous and next grays.
16+
let s:lightgray = "#75715e"
17+
let s:white = "#f8f8f2"
18+
let s:lime = "#a6e22e"
19+
let s:yellow = "#e6db74"
20+
let s:purple = "#ae81ff"
21+
let s:cyan = "#66d9ef"
22+
let s:orange = "#fd971f"
23+
let s:magenta = "#f92672"
24+
25+
" Terminal versions
26+
let s:tblack = 235
27+
let s:tdarkgray = 238
28+
let s:tgray = 240
29+
let s:tlightgray = 242
30+
let s:twhite = 255
31+
let s:tlime = 148
32+
let s:tyellow = 186
33+
let s:tpurple = 141
34+
let s:tcyan = 81
35+
let s:torange = 208
36+
let s:tmagenta = 197
37+
38+
hi clear
39+
if exists("syntax on")
40+
syntax reset
41+
endif
42+
43+
set t_Co=256
44+
let g:colors_name = "monokai"
45+
46+
" For relevant help:
47+
" :help highlight-groups
48+
" :help cterm-colors
49+
" :help group-name
50+
51+
" For testing:
52+
" :source $VIMRUNTIME/syntax/hitest.vim
53+
54+
exe "hi! Normal ctermfg=".s:twhite ." ctermbg=".s:tblack ." cterm=NONE guifg=".s:white ." guibg=".s:black ." gui=NONE"
55+
56+
exe "hi! Comment ctermfg=".s:tlightgray." ctermbg=NONE" ." cterm=NONE guifg=".s:lightgray." guibg=NONE gui=NONE"
57+
" *Comment any comment
58+
59+
exe "hi! Constant ctermfg=".s:tpurple ." ctermbg=NONE cterm=bold guifg=".s:purple ." guibg=NONE gui=bold"
60+
" *Constant any constant
61+
" String a string constant: "this is a string"
62+
" Character a character constant: 'c', '\n'
63+
" Number a number constant: 234, 0xff
64+
" Boolean a boolean constant: TRUE, false
65+
" Float a floating point constant: 2.3e10
66+
exe "hi! String ctermfg=".s:tyellow ." ctermbg=NONE cterm=NONE guifg=".s:yellow ." guibg=NONE gui=NONE"
67+
exe "hi! Number ctermfg=".s:tpurple ." ctermbg=NONE cterm=NONE guifg=".s:purple ." guibg=NONE gui=NONE"
68+
exe "hi! Boolean ctermfg=".s:tcyan ." ctermbg=NONE cterm=NONE guifg=".s:cyan ." guibg=NONE gui=NONE"
69+
70+
exe "hi! Identifier ctermfg=".s:tlime ." ctermbg=NONE cterm=NONE guifg=".s:lime ." guibg=NONE gui=NONE"
71+
" *Identifier any variable name
72+
" Function function name (also: methods for classes)
73+
74+
exe "hi! Statement ctermfg=".s:tmagenta ." ctermbg=NONE cterm=bold guifg=".s:magenta ." guibg=NONE gui=bold"
75+
" *Statement any statement
76+
" Conditional if, then, else, endif, switch, etc.
77+
" Repeat for, do, while, etc.
78+
" Label case, default, etc.
79+
" Operator "sizeof", "+", "*", etc.
80+
" Keyword any other keyword
81+
" Exception try, catch, throw
82+
exe "hi! Operator ctermfg=".s:tmagenta ." ctermbg=NONE cterm=NONE guifg=".s:magenta ." guibg=NONE gui=NONE"
83+
exe "hi! Exception ctermfg=".s:tlime ." ctermbg=NONE cterm=bold guifg=".s:lime ." guibg=NONE gui=bold"
84+
85+
exe "hi! PreProc ctermfg=".s:tmagenta ." ctermbg=NONE cterm=bold guifg=".s:magenta ." guibg=NONE gui=bold"
86+
" *PreProc generic Preprocessor
87+
" Include preprocessor #include
88+
" Define preprocessor #define
89+
" Macro same as Define
90+
" PreCondit preprocessor #if, #else, #endif, etc.
91+
92+
exe "hi! Type ctermfg=".s:tcyan ." ctermbg=NONE cterm=bold guifg=".s:cyan ." guibg=NONE gui=bold"
93+
" *Type int, long, char, etc.
94+
" StorageClass static, register, volatile, etc.
95+
" Structure struct, union, enum, etc.
96+
" Typedef A typedef
97+
exe "hi! StorageClass ctermfg=".s:tmagenta ." ctermbg=NONE cterm=bold guifg=".s:magenta ." guibg=NONE gui=bold"
98+
99+
exe "hi! Special ctermfg=".s:torange ." ctermbg=NONE cterm=NONE guifg=".s:orange ." guibg=NONE gui=NONE"
100+
" *Special any special symbol
101+
" SpecialChar special character in a constant
102+
" Tag you can use CTRL-] on this
103+
" Delimiter character that needs attention
104+
" SpecialComment special things inside a comment
105+
" Debug debugging statements
106+
exe "hi! Tag ctermfg=".s:tmagenta ." ctermbg=NONE cterm=bold guifg=".s:magenta ." guibg=NONE gui=bold"
107+
exe "hi! SpecialComment ctermfg=".s:twhite ." ctermbg=NONE cterm=bold guifg=".s:white ." guibg=NONE gui=bold"
108+
109+
exe "hi! Underlined ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline"
110+
" *Underlined text that stands out, HTML links
111+
112+
exe "hi! Ignore ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE"
113+
" *Ignore left blank, hidden |hl-Ignore|
114+
115+
exe "hi! Error ctermfg=".s:tmagenta ." ctermbg=NONE cterm=bold,reverse guifg=".s:magenta ." guibg=NONE gui=bold,reverse"
116+
" *Error any erroneous construct
117+
118+
exe "hi! Todo ctermfg=".s:twhite ." ctermbg=NONE cterm=bold guifg=".s:white ." guibg=NONE gui=bold"
119+
" *Todo anything that needs extra attention; mostly the
120+
" keywords TODO FIXME and XXX
121+
122+
123+
" Extended highlighting
124+
exe "hi! SpecialKey ctermfg=".s:torange ." ctermbg=NONE cterm=NONE guifg=".s:orange ." guibg=NONE gui=NONE"
125+
exe "hi! NonText ctermfg=".s:tdarkgray ." ctermbg=NONE cterm=NONE guifg=".s:darkgray ." guibg=NONE gui=NONE"
126+
exe "hi! StatusLine ctermfg=".s:twhite ." ctermbg=".s:tdarkgray ." cterm=bold guifg=".s:white ." guibg=".s:darkgray ." gui=bold"
127+
exe "hi! StatusLineNC ctermfg=".s:tblack ." ctermbg=".s:tgray ." cterm=NONE guifg=".s:black ." guibg=".s:gray ." gui=NONE"
128+
exe "hi! Visual ctermfg=NONE ctermbg=".s:tdarkgray ." cterm=NONE guifg=NONE guibg=".s:darkgray ." gui=NONE"
129+
exe "hi! Directory ctermfg=".s:tpurple ." ctermbg=NONE cterm=NONE guifg=".s:purple ." guibg=NONE gui=NONE"
130+
exe "hi! ErrorMsg ctermfg=".s:twhite ." ctermbg=".s:tmagenta ." cterm=bold guifg=".s:white ." guibg=".s:magenta ." gui=bold"
131+
exe "hi! IncSearch ctermfg=".s:tblack ." ctermbg=".s:tyellow ." cterm=NONE guifg=".s:black ." guibg=".s:yellow ." gui=NONE"
132+
exe "hi! Search ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline"
133+
exe "hi! MoreMsg ctermfg=".s:tblack ." ctermbg=".s:tcyan ." cterm=NONE guifg=".s:black ." guibg=".s:cyan ." gui=NONE"
134+
exe "hi! ModeMsg ctermfg=".s:tlime ." ctermbg=".s:tblack ." cterm=NONE guifg=".s:lime ." guibg=".s:black ." gui=NONE"
135+
exe "hi! LineNr ctermfg=".s:tlightgray." ctermbg=".s:tblack ." cterm=NONE guifg=".s:lightgray." guibg=".s:black ." gui=NONE"
136+
exe "hi! Question ctermfg=".s:tcyan ." ctermbg=NONE cterm=bold guifg=".s:cyan ." guibg=NONE gui=bold"
137+
exe "hi! VertSplit ctermfg=".s:tlightgray." ctermbg=".s:tdarkgray ." cterm=NONE guifg=".s:lightgray." guibg=".s:darkgray ." gui=NONE"
138+
exe "hi! Title ctermfg=".s:twhite ." ctermbg=NONE cterm=bold guifg=".s:white ." guibg=NONE gui=bold"
139+
exe "hi! VisualNOS ctermfg=NONE ctermbg=".s:tdarkgray ." cterm=standout guifg=NONE guibg=".s:darkgray ." gui=standout"
140+
exe "hi! WarningMsg ctermfg=".s:tblack ." ctermbg=".s:tyellow ." cterm=bold guifg=".s:black ." guibg=".s:yellow ." gui=bold"
141+
exe "hi! WildMenu ctermfg=".s:tcyan ." ctermbg=".s:tblack ." cterm=NONE guifg=".s:cyan ." guibg=".s:black ." gui=NONE"
142+
exe "hi! Folded ctermfg=".s:tlightgray." ctermbg=".s:tblack ." cterm=NONE guifg=".s:lightgray." guibg=".s:black ." gui=NONE"
143+
exe "hi! FoldColumn ctermfg=".s:tlightgray." ctermbg=".s:tblack ." cterm=NONE guifg=".s:lightgray." guibg=".s:black ." gui=NONE"
144+
exe "hi! DiffAdd ctermfg=".s:tblack ." ctermbg=".s:tlime ." cterm=NONE guifg=".s:black ." guibg=".s:lime ." gui=NONE"
145+
exe "hi! DiffChange ctermfg=".s:tblack ." ctermbg=".s:tyellow ." cterm=NONE guifg=".s:black ." guibg=".s:yellow ." gui=NONE"
146+
exe "hi! DiffDelete ctermfg=".s:tblack ." ctermbg=".s:tmagenta ." cterm=NONE guifg=".s:black ." guibg=".s:magenta ." gui=NONE"
147+
exe "hi! DiffText ctermfg=".s:tblack ." ctermbg=".s:tcyan ." cterm=NONE guifg=".s:black ." guibg=".s:cyan ." gui=NONE"
148+
exe "hi! SignColumn ctermfg=".s:tlime ." ctermbg=".s:tblack ." cterm=NONE guifg=".s:lime ." guibg=".s:black ." gui=NONE"
149+
exe "hi! Conceal ctermfg=".s:tdarkgray ." ctermbg=NONE cterm=NONE guifg=".s:darkgray ." guibg=NONE gui=NONE"
150+
exe "hi! SpellBad ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=undercurl guisp=".s:magenta
151+
exe "hi! SpellCap ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=undercurl guisp=".s:cyan
152+
exe "hi! SpellRare ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=undercurl guisp=".s:white
153+
exe "hi! SpellLocal ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=undercurl guisp=".s:cyan
154+
exe "hi! Pmenu ctermfg=".s:twhite ." ctermbg=".s:tlightgray." cterm=NONE guifg=".s:white ." guibg=".s:lightgray." gui=NONE"
155+
exe "hi! PmenuSel ctermfg=".s:tlime ." ctermbg=".s:tdarkgray ." cterm=NONE guifg=".s:lime ." guibg=".s:darkgray ." gui=NONE"
156+
exe "hi! PmenuSbar ctermfg=NONE ctermbg=".s:tgray ." cterm=NONE guifg=NONE guibg=".s:gray ." gui=NONE"
157+
exe "hi! PmenuThumb ctermfg=NONE ctermbg=".s:twhite ." cterm=NONE guifg=NONE guibg=".s:white ." gui=NONE"
158+
exe "hi! TabLine ctermfg=".s:tlightgray." ctermbg=".s:tblack ." cterm=bold guifg=".s:lightgray." guibg=".s:black ." gui=bold"
159+
exe "hi! TabLineFill ctermfg=".s:tblack ." ctermbg=".s:tblack ." cterm=NONE guifg=".s:black ." guibg=".s:black ." gui=NONE"
160+
exe "hi! TabLineSel ctermfg=".s:twhite ." ctermbg=".s:tlightgray." cterm=bold guifg=".s:white ." guibg=".s:lightgray." gui=bold"
161+
exe "hi! CursorColumn ctermfg=NONE ctermbg=".s:tdarkgray ." cterm=NONE guifg=NONE guibg=".s:darkgray ." gui=NONE"
162+
exe "hi! CursorLine ctermfg=NONE ctermbg=".s:tdarkgray ." cterm=NONE guifg=NONE guibg=".s:darkgray ." gui=NONE"
163+
exe "hi! CursorLineNr ctermfg=".s:tlime ." ctermbg=".s:tblack ." cterm=NONE guifg=".s:lime ." guibg=".s:black ." gui=NONE"
164+
exe "hi! ColorColumn ctermfg=NONE ctermbg=".s:tgray ." cterm=NONE guifg=NONE guibg=".s:gray ." gui=NONE"
165+
exe "hi! Cursor ctermfg=".s:tblack ." ctermbg=".s:twhite ." cterm=NONE guifg=".s:black " guibg=".s:white ." gui=NONE"
166+
hi! link lCursor Cursor
167+
exe "hi! MatchParen ctermfg=NONE ctermbg=NONE cterm=reverse,underline guifg=NONE guibg=NONE gui=reverse,underline"
168+
169+
" Non-standard stuff
170+
exe "hi! Argument ctermfg=".s:torange ." ctermbg=NONE cterm=NONE guifg=".s:orange ." guibg=NONE gui=NONE"
171+
172+
" Must be at the end due to a bug in VIM trying to figuring out automagically
173+
" if the background set through Normal highlight group is dark or light.
174+
" https://groups.google.com/forum/#!msg/vim_dev/afPqwAFNdrU/nqh6tOM87QUJ
175+
set background=dark

0 commit comments

Comments
 (0)