From e573b3020c032400eed60b649a2cbf55266e6bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 30 Jun 2016 16:03:25 +0200 Subject: Add current configurations from old repository --- vim/bundle/tlib_vim/autoload/tlib/syntax.vim | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 vim/bundle/tlib_vim/autoload/tlib/syntax.vim (limited to 'vim/bundle/tlib_vim/autoload/tlib/syntax.vim') diff --git a/vim/bundle/tlib_vim/autoload/tlib/syntax.vim b/vim/bundle/tlib_vim/autoload/tlib/syntax.vim new file mode 100755 index 0000000..aa30b66 --- /dev/null +++ b/vim/bundle/tlib_vim/autoload/tlib/syntax.vim @@ -0,0 +1,38 @@ +" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) +" @Website: http://www.vim.org/account/profile.php?user_id=4037 +" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) +" @Revision: 13 + + +function! tlib#syntax#Collect() "{{{3 + let acc = {} + let syn = '' + for line in tlib#cmd#OutputAsList('syntax') + if line =~ '^---' + continue + elseif line =~ '^\w' + let ml = matchlist(line, '^\(\w\+\)\s\+\(xxx\s\+\(.*\)\|\(cluster.*\)\)$') + if empty(ml) + " echoerr 'Internal error: '. string(line) + else + let [m_0, syn, m_1, m_def1, m_def2; m_rest] = ml + let acc[syn] = [empty(m_def1) ? m_def2 : m_def1] + endif + else + call add(acc[syn], matchstr(line, '^\s\+\zs.*$')) + endif + endfor + return acc +endf + + +" :def: function! tlib#syntax#Names(?rx='') +function! tlib#syntax#Names(...) "{{{3 + TVarArg 'rx' + let names = keys(tlib#syntax#Collect()) + if !empty(rx) + call filter(names, 'v:val =~ rx') + endif + return names +endf + -- cgit v1.2.3