# [texworks] SCRIPTING: Autocompletion based on the current file.

Henrik Skov Midtiby henrikmidtiby at gmail.com
Mon Dec 27 08:59:14 CET 2010

Hi

I have just started messing around with the texworks scripting
capabilities, and a lot of possibilities begin to appear. I hope to
find time to explore it further ;-)

My first real script is a kind of autocompleter, inspired by the one
found in vim. It looks at the word you were typing when the script was
activated and locates matching words in the current file. The script
is uploaded to the script issue [1].

Some ideas for where the script can be improved:
* look for matching words in related files (files opened by texworks,
bibtex file, ...)
* context aware: only locate labels when autocompleting a parameter to
a \ref command

My question is then how to determine the other tex files witch are
opened by texworks when the script is invoked?

Best regards,
Henrik Skkov Midtiby