为了突出显示,我如何匹配用星号突出显示的行?
1. Really big title
*******************
最佳答案
在 Markdown 高亮 (https://github.com/plasticboy/vim-markdown/blob/master/syntax/mkd.vim) 中,plasticboy 是这样做的:
"HTML headings
syn region htmlH1 start="^\s*#" end="\($\|#\+\)" contains=@Spell
syn region htmlH2 start="^\s*##" end="\($\|#\+\)" contains=@Spell
syn region htmlH3 start="^\s*###" end="\($\|#\+\)" contains=@Spell
syn region htmlH4 start="^\s*####" end="\($\|#\+\)" contains=@Spell
syn region htmlH5 start="^\s*#####" end="\($\|#\+\)" contains=@Spell
syn region htmlH6 start="^\s*######" end="\($\|#\+\)" contains=@Spell
syn match htmlH1 /^.\+\n=\+$/ contains=@Spell "<-- Here is the one I think you want
syn match htmlH2 /^.\+\n-\+$/ contains=@Spell
为了完整起见,Markdown header 如下所示:
H1 header
=========
H2 header
---------
关于vim - 如何匹配带****下划线的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8453590/