Created
May 30, 2017 11:39
-
-
Save sunjon/26068c984fff1c428133539d7fa1a229 to your computer and use it in GitHub Desktop.
vim regex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Parse current buffer :syntax for hl names that link to hl-groups | |
function! activewin#syntax#Parse() | |
redir => l:buf_syntax | |
silent exec 'syntax' | |
redir END | |
let l:group_keys = [] | |
let l:hl_pattern = '^\w\+\(\_.*links to\)\@=' | |
call substitute(l:buf_syntax, l:hl_pattern, '\=add(l:group_keys, submatch(0))', 'g') | |
echom string(l:group_keys) | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment