简体   繁体   中英

How can I expand a setting or variable in a vim regular expression?

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.

尝试以下方法而不是match LeadingSpaces /^ \\{3,}/

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM