I am trying to make text bold if it appears after a series of
# hashes. This is the line in my
au BufRead,BufNewFile *.txt hi header cterm=cyan ctermbg=red
and my attempted regular expressions:
au BufRead,BufNewFile *.txt syn match header /\n#+\zs.*\ze/ au BufRead,BufNewFile *.txt syn match header /^#+\zs.*\ze/ "Why doesn't ^ work?
This sort of works, but it also matches the
#s and some incorrect text. It's also very slow and takes about ~10 seconds to match on my macbook:
au BufRead,BufNewFile *.txt syn match header /\zs\n#*\w*\ze/
I'm not sure what I'm doing wrong -- these work on online regex testers.
On this tester, the regex
^#*(.*) works perfectly, where I'm matching with the first capture group. How do I translate this for vim?