4

Is it somehow possible to extend TexStudio to use dictionary words in autocompletion?

For example, when I type "som", I want the autocompletion list to show me all words from the dictionary starting with "som". I know TexStudio uses autocompletion for words that already appear in the same document.

I've tried to create a .CWL file, but apparently it is only for commands and plain words are not supported.

1

2 Answers 2

1

TeXstudio only has a command completion (based on the cwl files). There is no word completion (also not for words that already appear in the document).

You can however achieve something similar for fixed word lists by scripting.

2
  • Thanks for pointing out the scripting possibility. I'm afraid that the posted example of a fixed list is not exactly what I was looking for, because it always uses the first item in the list that starts with the given text. Is it possible via scripting to show the auto completion dropdown box and fill it manually?
    – Daniel
    Commented Mar 13, 2014 at 6:40
  • No, it is not possible to access the completer via scripting. Commented Mar 15, 2014 at 10:37
0

However, you can achieve it using the following tweaks. First convert the dictionary file to cwl file by adding \ before each word, remove /something, e.g. /SM patter and add the that file to your configuration file, e.g. ~/.config/texstudio in Mac OS X. Add this file in the preference panel of texstudio will enable you to get a list of words for autocompletion when you type /. However, when you select a word, an extra / will be shown in front of the word, as should be the case of a command. To remedy this, you can define a macro, e.g. trigger by // that remove this extra /. The macro to do this is

%SCRIPT
cursor.movePosition(1,cursorEnums.StartOfWord)
cursor.deletePreviousChar()

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .