From: Simon Ruderich Date: Thu, 15 Nov 2012 20:00:19 +0000 (+0100) Subject: vimrc: Add StatuslineSyntaxGroup(). X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=commitdiff_plain;h=cbf6334225a37daa7e89cdd9797358acef12e68d vimrc: Add StatuslineSyntaxGroup(). Useful to debug color schemes but not used by default. --- diff --git a/vimrc b/vimrc index 8922942..3f94aef 100644 --- a/vimrc +++ b/vimrc @@ -373,6 +373,16 @@ if has('statusline') endif endfunction + " Return current syntax group in brackets or nothing if there's none. + function! StatuslineSyntaxGroup() + let l:group = synIDattr(synID(line('.'), col('.'), 1), 'name') + if l:group != '' + return '[' . l:group . '] ' + else + return '' + endif + endfunction + set statusline= " on the left set statusline+=%02n " buffer number