2 " @Author: Thomas Link (mailto:micathom AT gmail com?subject=[vim])
3 " @Website: http://www.vim.org/account/profile.php?user_id=4037
4 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5 " @Created: 2007-11-19.
6 " @Last Change: 2007-11-19.
9 if &cp || exists("loaded_tlib_syntax_autoload")
12 let loaded_tlib_syntax_autoload = 1
17 function! tlib#syntax#Collect() "{{{3
20 for line in tlib#cmd#OutputAsList('syntax')
24 let ml = matchlist(line, '^\(\w\+\)\s\+\(xxx\s\+\(.*\)\|\(cluster.*\)\)$')
26 echoerr 'Internal error: '. line
28 let [m_0, syn, m_1, m_def1, m_def2; m_rest] = ml
29 let acc[syn] = [empty(m_def1) ? m_def2 : m_def1]
32 call add(acc[syn], matchstr(line, '^\s\+\zs.*$'))
39 " :def: function! tlib#syntax#Names(?rx='')
40 function! tlib#syntax#Names(...) "{{{3
42 let names = keys(tlib#syntax#Collect())
44 call filter(names, 'v:val =~ rx')