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. Commented May 27, 2016 at 7:42
  • In general, new commands are in the autocomplete list. Where and how did you define it? Commented May 28, 2016 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
    Commented May 28, 2016 at 13:38

2 Answers 2


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

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

enter image description here

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

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

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


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.

You must log in to answer this question.

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