Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个正则表达式 ,^ \{3,}/并且想使用设置或变量的值来代替3. 这是上下文:
^ \{3,}/
3
match LeadingSpaces /^ \{3,}/ highlight LeadingSpaces ctermbg=red guibg=red
我想用 的值tabstop代替 3。或者,我可以设置一个要使用的新变量。
tabstop
尝试以下而不是match LeadingSpaces /^ \{3,}/:
match LeadingSpaces /^ \{3,}/
execute 'match LeadingSpaces /^ \{'.&tabstop.',}/'