# TexStudio autocompletes when I type braces

When I try to type something in texstudio that has a macro associated, such as \hl{} it actually autocompletes to \hline{} as soon as I type the brace (it also does this for brackets). Words don't autocomplete when I type a space or when I hit escape. However, it's super annoying to have to hit escape every time I type a function that might autocomplete on me.

I know that part of the problem is that new commands aren't in the Texstudio autocomplete list, but I feel like typing a brace should override autocomplete in any case. Do you have any suggestions?

• press ESC when the \hline pops up. – Bernhard Kleine May 27 '16 at 7:42
• In general, new commands are in the autocomplete list. Where and how did you define it? – Tim Hoffmann May 28 '16 at 12:02
• Thanks. I'd already figured out ESC, but it's an annoying extra stroke that isn't needed on all words. The new commands were defined in an associated .sty file that I've created myself. I know how to add \hl to the autocomplete by configuring it to use color, however, it's still not including my own packages. Since this is a potential problem, I'd still prefer to have autocomplete end as-is when I type anything that is (a) not a letter, (b) not tab. Tab autocomplete is nice. Brace autocomplete is not nice. – Necarion May 28 '16 at 13:38

## 2 Answers

Uncheck the option (make sure advanced options is toggled):

Configure TeXstudio -> Completion -> Complete selected text when non-word character is pressed


then \hl{ will no longer autocomplete to \hline{}.

• This is what I have been looking for my entire life. I would have upvoted more than 1 time if I could. – BigbearZzz Mar 31 '18 at 23:56

Create a file called "soul.cwl" file with the contents

\hl


in the config directory. This is normally placed in ~/.config/texstudio under linux and usually "c:\Documents and Settings/User/AppData/Roaming/texstudio" in windows.

This it will see hl as a command to autocomplete to. See also the helpfile for texstudio.