gpt4 book ai didi

vim - 如何匹配带****下划线的行

转载 作者:行者123 更新时间:2023-12-04 22:29:37 29 4
gpt4 key购买 nike

为了突出显示,我如何匹配用星号突出显示的行?

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/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com