From bd7dcb738f8fe04a8d37ee4804c902533fd80e49 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Sat, 24 Dec 2016 13:20:22 +0000 Subject: [PATCH] Add :Syntack command to view syntax group stack --- plugin/functions.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugin/functions.vim b/plugin/functions.vim index 52d568c..b8704dc 100644 --- a/plugin/functions.vim +++ b/plugin/functions.vim @@ -28,6 +28,17 @@ function! CloneHighlightGroupWithAttributes(group, new_group, attributes) \' term='.a:attributes.' cterm='.a:attributes.' gui='.a:attributes endfunction +function! 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 Synstack() + " Strip trailing whitespace function! StripWhitespace() let l = line(".")