Reputation: 16036
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.
Upvotes: 7
Views: 995
Reputation: 208605
Try the following instead of match LeadingSpaces /^ \{3,}/
:
execute 'match LeadingSpaces /^ \{'.&tabstop.',}/'
Upvotes: 8