Add :Syntack command to view syntax group stack

This commit is contained in:
Kenneth Benzie 2016-12-24 13:20:22 +00:00
parent 9fbe25fee7
commit bd7dcb738f

View File

@ -28,6 +28,17 @@ function! CloneHighlightGroupWithAttributes(group, new_group, attributes)
\' term='.a:attributes.' cterm='.a:attributes.' gui='.a:attributes
endfunction
function! <SID>Synstack()
for id in synstack(line('.'), col('.'))
let attributes = synIDattr(id, 'name')
let attr = synIDattr(id, 'fg')
if attr != ''
let attributes = attributes.' fg='.attr
endif
endfor
endfunction
command Synstack :call <SID>Synstack()
" Strip trailing whitespace
function! <SID>StripWhitespace()
let l = line(".")