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?

1 Answer 1

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.