22

Each time I use autocompletion in TeXstudio for a block environment, e.g.

\begin{itemize}
content...
\end{itemize}

the "content..." is automatically inserted. Is it possible to disable that? It slows me down, because I need to delete it before filling in the contents of the block. I would like the autocomplete to produce just e.g.

\begin{itemize}
                        <-- Just a blank line here
\end{itemize}

A partial solution I found: Use CTRL+RIGHT to jump to the "content..." and overwrite it. But as I said, I would prefer not to have it there at all.

6
  • Did you find a solution? If yes, please post it.
    – J. Schmidt
    Apr 18, 2020 at 11:14
  • Unfortunately not.
    – Augustin
    Apr 19, 2020 at 16:15
  • Currently (Apr 2020) this is hard coded in TeXstudio. See related code lines. The code comment says This is currently hard coded for the most common cases. Might become user-definable in the future (via addition to the snippet code (what would that imply for cwls?) or other means. Maybe you can open an issue under TeXstudio's GitHub repo. Apr 20, 2020 at 10:17
  • @Augustin, If my answer does not answer your question somehow, please state why. Elsewise, you should accept it.
    – J. Schmidt
    Apr 21, 2020 at 9:12
  • @muzimuzhiZ Good catch and good idea. I opened an issue: github.com/texstudio-org/texstudio/issues/1050.
    – Augustin
    Apr 22, 2020 at 10:01

4 Answers 4

8

You need to disable insert arguments

Go to Options > Configure TexStudio > Make sure that Advanced Options is checked > Completion > Uncheck Insert arguments

1
  • 15
    Yes, that solves the problem, but some other nice things stop working, e.g. the \end{...} is not properly autocompleted.
    – Augustin
    Oct 9, 2016 at 11:49
5

Since it is not possible to obtain what you want, I found a way around the problem in some sense :

Start typing \begin, press Tab (not Enter !) when TexStudio proposes \begin{*environment-name*}. Then start typing your environment name, for example proof. When TexStudio proposes \begin{proof}, press Enter (not Tab !) and voila, you got yourself an environment without content... but also with the proper \end{proof} at the end.

Edit : if you still have insert arguments enabled in the options (see other answers) then content... will appear but it will be selected automatically so that when you type anything it will be replaced by what you write.

1
2

In Options > Configure TexStudio > Menu > &Latex > &Environnements, one could change the "Generique" commande by this line :

\begin{%<environment-name%:id:1%>}%\%\\end{%<environment-name%:id:1,mirror%>}

So far, it doesn't affect other autocompletions.

1
  • This solution doesn't seem to work for Macros that are defined as environments.
    – kennyB
    Jan 5, 2018 at 23:35
1

I think this might affect some other autocompletions, but this can be done by using the menu Options/Configure TeXstudio/Completion and by disabling 'Use placeholders'.

1
  • 4
    Yes, that solves the problem, but some other nice things stop working, e.g. the \end{...} is not properly autocompleted in some cases.
    – Augustin
    Oct 21, 2015 at 10:51

You must log in to answer this question.

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