-
Notifications
You must be signed in to change notification settings - Fork 0
/
syntax.vim
144 lines (127 loc) · 5.39 KB
/
syntax.vim
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
function! MyHighlights() abort
" highlight! link cssPositioningProp GruvboxAqua
" highlight! link cssMediaProp GruvboxAqua
" highlight! link cssBorderProp GruvboxAqua
" highlight! link javascriptReserved GruvboxRed
" highlight! link javascriptDebugger GruvboxRedBold
" highlight! link typescriptDebugger GruvboxRedBold
" highlight! link javascriptString GruvboxFg3
" highlight! link javascriptDomEventTargetMethod GruvboxAqua
" highlight! link javascriptObjectStaticMethod GruvboxAqua
" highlight! link javascriptPaymentShippingOptionProp GruvboxYellow
" highlight! link javascriptES6SetMethod GruvboxYellow
"make ts and js history the same
" highlight! link javascriptImport GruvboxOrange
" highlight! link javascriptExport GruvboxOrange
" highlight! link javascriptVariable GruvboxBlue
" highlight! link typescriptString GruvboxFg3
" highlight! link styledNestedRegion GruvboxAqua
" Tree-sitter
" highlight! link TSBoolean GruvboxFg3
" highlight! link TSConditional GruvboxFg3
" highlight! link TSConstructor GruvboxFg3
" highlight! link TSFunction GruvboxFg3
" highlight! link TSInclude GruvboxFg3
" highlight! link TSKeyword GruvboxFg3
" highlight! link TSKeywordOperator GruvboxFg3
" highlight! link TSMethod GruvboxFg3
" highlight! link TSNumber GruvboxFg3
" highlight! link TSOperator GruvboxFg3
" highlight! link TSParameter GruvboxFg3
" highlight! link TSProperty GruvboxFg3
" highlight! link TSPunctBracket GruvboxFg3
" highlight! link TSPunctDelimiter GruvboxFg3
" highlight! link TSPunctSpecial GruvboxFg3
" highlight! link TSString GruvboxFg3
" highlight! link TSTag GruvboxFg3
" highlight! link TSTagDelimiter GruvboxFg3
" highlight! link TSType GruvboxFg3
" highlight! link TSTypeBuiltin GruvboxFg3
" highlight! link TSVariable GruvboxFg3
" highlight! link TSVariableBuiltin GruvboxFg3
" change background
" hi clear Normal
highlight Normal guifg=GruvboxFg1 ctermfg=249 guibg=#1E1E1E ctermbg=0 gui=NONE cterm=NONE
endfunction
function! TreeSitterHighlight() abort
" highlight! TSBoolean guifg=blue
" highlight! TSConditional GruvboxFg3
" highlight! TSConstructor GruvboxFg3
" highlight! TSFunction GruvboxFg3
" highlight! TSInclude GruvboxFg3
highlight! TSKeyword guifg=#46BBF5
" highlight! TSKeywordOperator GruvboxFg3
" highlight! TSMethod GruvboxFg3
" highlight! TSNumber GruvboxFg3
" highlight! TSOperator GruvboxFg3
" highlight! TSParameter GruvboxFg3
" highlight! TSProperty GruvboxFg3
" highlight! TSPunctBracket GruvboxFg3
" highlight! TSPunctDelimiter GruvboxFg3
" highlight! TSPunctSpecial GruvboxFg3
" highlight! TSString GruvboxFg3
" highlight! TSTag guifg=#9C9695
" highlight! TSTagDelimiter GruvboxFg3
" highlight! TSType GruvboxFg3
" highlight! TSTypeBuiltin GruvboxFg3
" highlight! TSVariable guifg=#9C9695
" highlight! TSVariableBuiltin guifg=red
endfunction
function! TreeSitterHighlightGruvbox() abort
highlight! TSString guifg=#b8bb26
highlight! TSFunction guifg=#ebdbb2
highlight! TSParameter guifg=#8ec07c
highlight! TSConditional guifg=#8ec07c
highlight! TSVariable guifg=#fbf1c7
highlight! TSConstructor guifg=#fbf1c7
highlight! TSPunctBracket guifg=#fbf1c7
highlight! TSPunctDelimiter guifg=#fbf1c7
highlight! TSReturn guifg=#fb4934
highlight! TSArrow guifg=#fb4934
highlight! TSDebugger guifg=#fb4934 gui=bold
highlight! TSVariableBuiltin guifg=#fb4934
highlight! TSInclude guifg=#fe8019
highlight! TSExport guifg=#fe8019
highlight! TSKeyword guifg=#fe8019
highlight! TSJsxProp guifg=#fabd2f
highlight! TSJsxElement guifg=#b8bb26
highlight! TSTag guifg=#8ec07c
highlight! TSTagDelimiter guifg=#a89984
endfunction
function! TreeSitterHighlightMonokai() abort
highlight! TSInclude guifg=#F92672 gui=none
highlight! TSExport guifg=#F92672 gui=none
highlight! TSKeyword guifg=#66d9ef gui=italic
highlight! TSParameter guifg=#FD971F gui=italic
highlight! TSArrow guifg=#66d9ef gui=italic
highlight! TSProperty guifg=#E6DB74
highlight! TSPunctBracket guifg=#FFFFFF
highlight! TSPunctDelimiter guifg=#FFFFFF
highlight! TSDot guifg=#F92672
highlight! TSConstructor guifg=#66d9ef
highlight! TSReturn guifg=#F92672
highlight! TSVariable guifg=#FFFFFF
highlight! TSTagDelimiter guifg=#FFFFFF
highlight! TSJsxElement guifg=#66d9ef gui=italic
highlight! TSJsxProp guifg=#A6E22E
" highlight! TSType guifg=#66d9ef gui=italic
endfunction
augroup MyColors
autocmd!
" autocmd ColorScheme * call MyHighlights()
" autocmd FileType typescript,javascript,javascriptreact,typescriptreact call TreeSitterHighlightGruvbox()
" autocmd FileType coc-explorer :highlight! link Directory GruvboxBlueBold
" autocmd FileType LuaTree :highlight! link Directory GruvboxBlueBold
" autocmd ColorScheme * highlight! Normal guibg=#1E1E1E
augroup END
"Showing highlight groups
nmap <leader>sp :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
map <F7> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>