Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a regular expression, ^ {3,}/, and want to use the value of a setting or variable in place of the 3. Here's the context:

match LeadingSpaces /^ {3,}/
highlight LeadingSpaces ctermbg=red guibg=red

I'd like to use the value of tabstop in place of 3. Alternatively, I could set a new variable to be used.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
995 views
Welcome To Ask or Share your Answers For Others

1 Answer

Try the following instead of match LeadingSpaces /^ {3,}/:

execute 'match LeadingSpaces /^ {'.&tabstop.',}/'

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...