例如,我想要以下內容:
:match search /<div/ guib=Green
:match search /<\/div>/ guibf=Blue
但那是行不通的。
答案1
您必須定義突出顯示顏色。從:h :match
:mat[ch] {group} /{pattern}/
Define a pattern to highlight in the current window. It will
be highlighted with {group}. Example: >
:highlight MyGroup ctermbg=green guibg=green
:match MyGroup /TODO/
所以,像這樣:
:hi OpenTag guibg=green ctermbg=green
:hi CloseTag guibg=blue ctermbg=blue
:match OpenTag /<div>/
:2match CloseTag /<\/div>/