Skip to content

Instantly share code, notes, and snippets.

@Pablo1107
Forked from jrolfs/neomake-defaults.vim
Created April 11, 2019 21:51
Show Gist options
  • Save Pablo1107/8a03ea9ad745b2f43e8dd0a618166381 to your computer and use it in GitHub Desktop.
Save Pablo1107/8a03ea9ad745b2f43e8dd0a618166381 to your computer and use it in GitHub Desktop.
function! GetColorFromHighlightGroup(group, color, env)
return synIDattr(synIDtrans(hlID(a:group)), a:color, a:env)
endfunction
function! GetBackgroundColors(group)
return
\ ' ctermbg=' . GetColorFromHighlightGroup(a:group, 'bg', 'cterm') .
\ ' guibg=' . GetColorFromHighlightGroup(a:group, 'bg', 'gui')
endfunction
function! GetFrontgroundColors(group)
return
\ ' ctermfg=' . GetColorFromHighlightGroup(a:group, 'fg', 'cterm') .
\ ' guifg=' . GetColorFromHighlightGroup(a:group, 'fg', 'gui')
endfunction
function! NeoMakeDefaults()
let l:sign_bg = GetBackgroundColors('SignColumn')
let l:error_sign_fg = GetFrontgroundColors('ErrorMsg')
let l:warning_sign_fg = GetFrontgroundColors('Todo')
let l:information_sign_fg = GetFrontgroundColors('Question')
let l:default_sign_fg = GetFrontgroundColors('ModeMsg')
execute 'highlight NeomakeErrorDefault' . l:error_sign_fg . l:sign_bg
execute 'highlight NeomakeWarningDefault' . l:warning_sign_fg . l:sign_bg
execute 'highlight NeomakeInformationalDefault' . l:information_sign_fg . l:sign_bg
execute 'highlight NeomakeMessageDefault' . l:default_sign_fg . l:sign_bg
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment