0

What if I define keywords as combination of two list of strings?

E.g.

List1:

['B', 'G96', 'TPSS', 'RevTPSS', 'BRx', PBE', 'PBEh', 'wPBEh']

List2:

['VWN', 'P86', 'PW91', 'TPSS']

and a keyword is a combination of a word in List1 + a word in List2, e.g. 'RevTPSSTPSS' is a keyword, but a single 'TPSS' is not. How do I write the Gaussian syntax file?

2

The following should do the trick:

let list1 = ['B', 'G96', 'TPSS', 'RevTPSS', 'BRx', 'PBE', 'PBEh', 'wPBEh']
let list2 = ['VWN', 'P86', 'PW91', 'TPSS']
for a in list1
  for b in list2
    execute 'syntax keyword MyGroup' a . b
  endfor
endfor

highlight link MyGroup Function

The most relevant help sections are :h :execute and :h syn-keyword, so you might want to read those.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.