The editor that I use, Texmaker, provides code folding only for things in the language, like \section and \begin{foo} ... \end{foo}. I would like to be able to make my own folding sections, like in Visual C++ where I can write #pragma region foo ... #pragma endregion. Specifically, the first thing that I want to hide in any code is the includes at the beginning, in the case of LaTeX, the \usepackage{} commands. I had the idea of making a custom environment:
\newenvironment{folding}{}{}
\begin{folding}
\usepackage{geometry}
\end{folding}
However, this won't build. Can anybody explain why? Is there a way to define an environment such that this would work?
