aboutsummaryrefslogtreecommitdiffhomepage
path: root/.config/nvim/colors/ocean.vim
blob: ef5b1369793d62f1424892eab9671bfdcc06d6d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
scriptencoding utf-8


hi clear
let g:colors_name = 'ocean'



" Color palette {{{1

if &background ==# 'dark'
    let s:palette = {
        \ 'NONE':      'NONE',
        \ 'fg':        '#b1b1c8',
        \ 'bg':        '#101020',
        \ 'blue':      '#6e6eff',
        \ 'blue-bg':   '#202050',
        \ 'blue2':     '#70b0ff',
        \ 'comment':   '#8686bf',
        \ 'cursor':    '#5b5bb6',
        \ 'gray':      '#353535',
        \ 'gray2':     '#202020',
        \ 'green':     '#c4e088',
        \ 'green-bg':  '#204020',
        \ 'orange':    '#deab52',
        \ 'orange2':   '#ff7100',
        \ 'red':       '#a65f49',
        \ 'red-bg':    '#402020',
        \ 'selection': '#303060',
        \ 'yellow':    '#a68f49',
        \ 'yellow2':   '#a89562',
        \ 'yellow3':   '#5c5241',
        \ }
else
    let s:palette = {
        \ 'NONE':      'NONE',
        \ 'fg':        '#203050',
        \ 'bg':        '#f5f5ff',
        \ 'blue':      '#6e6eff',
        \ 'blue-bg':   '#202050',
        \ 'blue2':     '#6f8fff',
        \ 'comment':   '#a0a0e0',
        \ 'cursor':    '#5b5bb6',
        \ 'gray':      '#bebebe',
        \ 'gray2':     '#171717',
        \ 'green':     '#6f9226',
        \ 'green-bg':  '#204020',
        \ 'orange':    '#e79230',
        \ 'orange2':   '#ff7100',
        \ 'red':       '#d77253',
        \ 'red-bg':    '#402020',
        \ 'selection': '#f0f0d0',
        \ 'yellow':    '#cba224',
        \ 'yellow2':   '#af8e29',
        \ 'yellow3':   '#c6b683',
        \ }
endif



" Semantic highlight group {{{1

function! s:hl(group_name, guifg, guibg, attr) abort
    execute printf('hi! ocean%s guifg=%s guibg=%s gui=%s cterm=%s',
       \ a:group_name,
       \ s:palette[a:guifg],
       \ s:palette[a:guibg],
       \ a:attr,
       \ a:attr)
endfunction


call s:hl('AnalysisError',            'red',     'NONE',        'underline')
call s:hl('AnalysisWarning',          'yellow2', 'NONE',        'underline')
call s:hl('Cursor',                   'fg',      'cursor',      'NONE')
call s:hl('DecorationBold',           'NONE',    'NONE',        'bold')
call s:hl('DecorationUnderlined',     'NONE',    'NONE',        'underline')
call s:hl('DiffAdd',                  'NONE',    'blue-bg',     'NONE')
call s:hl('DiffChange',               'NONE',    'green-bg',    'NONE')
call s:hl('DiffDelete',               'NONE',    'red-bg',      'NONE')
call s:hl('DiffText',                 'NONE',    'green-bg',    'underline')
call s:hl('Error',                    'red',     'NONE',        'NONE')
call s:hl('Hidden',                   'bg',      'bg',          'NONE')
call s:hl('Normal',                   'fg',      'bg',          'NONE')
call s:hl('Prompt',                   'comment', 'NONE',        'bold')
call s:hl('Search',                   'bg',      'yellow3',     'NONE')
call s:hl('Special',                  'red',     'NONE',        'NONE')
call s:hl('SpecialKey',               'gray',    'NONE',        'NONE')
call s:hl('SyntaxComment',            'comment', 'NONE',        'NONE')
call s:hl('SyntaxCommentSpecial',     'fg',      'NONE',        'bold')
call s:hl('SyntaxConstant',           'red',     'NONE',        'NONE')
call s:hl('SyntaxIdentifier',         'green',   'NONE',        'NONE')
call s:hl('SyntaxStatement',          'blue',    'NONE',        'bold')
call s:hl('SyntaxStatement2',         'blue',    'NONE',        'NONE')
call s:hl('SyntaxString',             'yellow',  'NONE',        'NONE')
call s:hl('SyntaxType',               'blue2',   'NONE',        'NONE')
call s:hl('Title',                    'orange',  'NONE',        'NONE')
call s:hl('UiCompletion',             'fg',      'gray',        'NONE')
call s:hl('UiSelection',              'NONE',    'selection',   'NONE')
call s:hl('UiStatusLine',             'fg',      'gray',        'NONE')
call s:hl('UiStatusLineModeCommand',  'bg',      'blue',        'bold')
call s:hl('UiStatusLineModeInsert',   'bg',      'green',       'bold')
call s:hl('UiStatusLineModeNormal',   'bg',      'blue',        'bold')
call s:hl('UiStatusLineModeOperator', 'bg',      'blue',        'bold')
call s:hl('UiStatusLineModeOther',    'bg',      'blue',        'bold')
call s:hl('UiStatusLineModeReplace',  'bg',      'red',         'bold')
call s:hl('UiStatusLineModeTerminal', 'bg',      'blue',        'bold')
call s:hl('UiStatusLineModeVisual',   'bg',      'orange',      'bold')
call s:hl('UiStatusLineNC',           'comment', 'gray2',       'NONE')
call s:hl('UiTabLine',                'fg',      'gray',        'NONE')
call s:hl('UiTabLineNC',              'comment', 'bg',          'NONE')
call s:hl('UiTarget',                 'orange2', 'NONE',        'underline')
call s:hl('Warning',                  'yellow2', 'NONE',        'NONE')

delfunction! s:hl



" Highlight link {{{1

" :sort /hi! link \w\+ \+/

" Vim builtins {{{2

hi! link SpellBad       oceanAnalysisError
hi! link SpellCap       oceanAnalysisError
hi! link SpellLocal     oceanAnalysisWarning
hi! link SpellRare      oceanAnalysisWarning
hi! link Cursor         oceanCursor
hi! link CursorIM       oceanCursor
hi! link Underlined     oceanDecorationUnderlined
hi! link DiffAdd        oceanDiffAdd
hi! link DiffChange     oceanDiffChange
hi! link DiffDelete     oceanDiffDelete
hi! link DiffText       oceanDiffText
hi! link Error          oceanError
hi! link ErrorMsg       oceanError
hi! link EndOfBuffer    oceanHidden
hi! link MatchParen     oceanHidden
hi! link CursorLineNr   oceanNormal
hi! link Normal         oceanNormal
hi! link PMenu          oceanUiCompletion
hi! link PMenuSbar      oceanUiCompletion
hi! link PMenuThumb     oceanUiCompletion
hi! link MoreMsg        oceanPrompt
hi! link Question       oceanPrompt
hi! link IncSearch      oceanSearch
hi! link Search         oceanSearch
hi! link CursorColumn   oceanUiSelection
hi! link CursorLine     oceanUiSelection
hi! link FoldColumn     oceanUiSelection
hi! link LineNr         oceanUiSelection
hi! link PMenuSel       oceanUiSelection
hi! link SignColumn     oceanUiSelection
hi! link Visual         oceanUiSelection
hi! link Special        oceanSpecial
hi! link NonText        oceanSpecialKey
hi! link SpecialKey     oceanSpecialKey
hi! link VertSplit      oceanUiStatusLine
hi! link Comment        oceanSyntaxComment
hi! link Folded         oceanSyntaxComment
hi! link ModeMsg        oceanSyntaxComment
hi! link SpecialComment oceanSyntaxCommentSpecial
hi! link Todo           oceanSyntaxCommentSpecial
hi! link Constant       oceanSyntaxConstant
hi! link Identifier     oceanSyntaxIdentifier
hi! link Statement      oceanSyntaxStatement
hi! link Operator       oceanSyntaxStatement2
hi! link PreProc        oceanSyntaxStatement2
hi! link Character      oceanSyntaxString
hi! link String         oceanSyntaxString
hi! link Directory      oceanSyntaxType
hi! link Type           oceanSyntaxType
hi! link Title          oceanTitle
hi! link WildMenu       oceanTitle
hi! link ColorColumn    oceanUiSelection
hi! link WarningMsg     oceanWarning


" 'statusline' and 'tabline' {{{2

" Cited from ':h hl-StatusLineNC':
" > Note: if this is equal to "StatusLine" Vim will use "^^^" in
" > the status line of the current window.
hi! link StatusLine             oceanUiStatusLine
hi! link StatusLineNC           oceanUiStatusLineNC
hi! link statusLineModeNormal   oceanUiStatusLineModeNormal
hi! link statusLineModeInsert   oceanUiStatusLineModeInsert
hi! link statusLineModeVisual   oceanUiStatusLineModeVisual
hi! link statusLineModeOperator oceanUiStatusLineModeOperator
hi! link statusLineModeReplace  oceanUiStatusLineModeReplace
hi! link statusLineModeCommand  oceanUiStatusLineModeCommand
hi! link statusLineModeTerminal oceanUiStatusLineModeTerminal
hi! link statusLineModeOther    oceanUiStatusLineModeOther


hi! link TabLineSel  oceanUiTabLine
hi! link TabLine     oceanUiTabLineNC
hi! link TabLineFill oceanHidden


" Third-party plugins {{{2

hi! link YankRoundRegion oceanUiSelection

hi! link OperatorSandwichAdd    oceanUiSelection
hi! link OperatorSandwichBuns   oceanUiSelection
hi! link OperatorSandwichChange oceanUiSelection
hi! link OperatorSandwichDelete oceanUiSelection

hi! link EasyMotionMoveHL oceanSearch
hi! link EasyMotionTarget oceanUiTarget


" File types {{{2

" c {{{3

hi! link cOctalZero oceanConstant

" cpp {{{3

hi! link cppRawStringDelimiter oceanSyntaxString

" html {{{3

hi! link htmlEndTag  oceanSyntaxStatement2
hi! link htmlTag     oceanSyntaxStatement2
hi! link htmlTagName oceanSyntaxStatement2

" php {{{3

hi! link phpParent          oceanNormal
hi! link phpOperator        oceanNormal
hi! link phpRelation        oceanNormal
hi! link phpDocTags         oceanSyntaxCommentSpecial
hi! link phpSpecialFunction oceanSyntaxIdentifier

" ruby {{{3

hi! link rubyDataDirective   oceanSyntaxStatement2
hi! link rubyStringDelimiter oceanSyntaxString





" sh {{{3

hi! link shQuote oceanSyntaxString
hi! link shDerefSimple oceanSyntaxIdentifier
hi! link shDerefVar oceanSyntaxIdentifier





" Utilities {{{1

command! -bar
    \ OceanGetHighlightGroupName
    \ echo synIDattr(synID(line('.'), col('.'), v:false), 'name')