-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhigh.vim
52 lines (47 loc) · 1.34 KB
/
high.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
" Highlight anything, create custom highlight in Vim
"
" Author: Bimba Laszlo <https://github.com/bimlas>
" Source: https://github.com/bimlas/vim-high
" License: MIT license
if exists('g:loaded_high')
finish
endif
let g:loaded_high = 1
let g:high = {
\ 'registered_groups': {},
\ 'group_members': {},
\ 'defaults': {
\ 'enabled': 1,
\ 'whitelist': [],
\ 'blacklist': ['help', 'qf'],
\ 'hlgroup': 'ErrorMsg',
\ 'priority': -1,
\ 'pattern': '',
\ '__group_name': '',
\ '__init_function': '',
\ '__update_function': '',
\ '__auto_highlight': 1,
\ '__match_id_index': -1,
\ },
\ }
if exists('g:high_lighters')
if has_key(g:high_lighters, '_')
call extend(g:high.defaults, remove(g:high_lighters, '_'))
endif
for group in keys(g:high_lighters)
call high#group#Register(group)
endfor
endif
command! -nargs=* -complete=customlist,high#commandline#Completion
\ HighDisable call high#commandline#Toggle(0, <f-args>)
command! -nargs=* -complete=customlist,high#commandline#Completion
\ HighEnable call high#commandline#Toggle(1, <f-args>)
command! -nargs=* -complete=customlist,high#commandline#Completion
\ HighToggle call high#commandline#Toggle(-1, <f-args>)
augroup high
autocmd!
autocmd WinEnter,BufWinEnter,FileType *
\ for group in values(g:high.registered_groups)
\ | call high#Light(group)
\ | endfor
augroup END