1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 06:00:05 +08:00

Add vim#highlight api

This commit is contained in:
wsdjeg 2017-05-01 22:05:51 +08:00
parent 4a6f11146d
commit 13b9bd1e40

View File

@ -0,0 +1,23 @@
let s:self = {}
function! s:self.group2dict(name) abort
let id = index(map(range(999), 'synIDattr(v:val, "name")'), a:name)
if id == -1
return {}
endif
let rst = {
\ 'name' : synIDattr(id, 'name'),
\ 'ctermbg' : synIDattr(id, 'bg'),
\ 'ctermfg' : synIDattr(id, 'fg'),
\ 'bold' : synIDattr(id, 'bold'),
\ 'italic' : synIDattr(id, 'italic'),
\ 'underline' : synIDattr(id, 'underline'),
\ 'guibg' :synIDattr(id, 'bg#'),
\ 'guifg' : synIDattr(id, 'fg#'),
\ }
return rst
endfunction
function! SpaceVim#api#vim#highlight#get() abort
return deepcopy(s:self)
endfunction