[Tex/LaTex] Notepad++ automatically completing \begin{env} \end{env}


Is there a way to configure Notepad++ to do the following:

  • After I type \begin{env} (and perhaps some shortcut keys), it automatically closes the environment with \end{env} and moves the cursor to a line between the opening and closure of the environment. Here env is any environment name.

I know this can be done in Emacs, as is shown in Get emacs to automatically insert \end{} commands after a \begin{} command. I'm wondering if there's a Notepad++ equivalent.

Best Answer

Following on from @Fuzzy's answer, I believe that it is Snippet Parameters that will help here, as detailed in https://github.com/erinata/FingerText/wiki/Snippet-parameters

Starting from notepad++, with the Fingertext plugin installed (details in Fuzzy's answer), go to:

Plugins-> Fingertext-> Toggle On/off SnippetDock-> Open Snippet Editor

Now enter, for example, env as triggertext, keep 3 as GLOBAL and enter the following into the Snippet Content

    $[![(environment body)]!]
\end{$[![envname]!]}$[![after environment]!][>END<]


This should now mean that when you type, for example


you receive

    (environment body)
\end{myenvironment}$[![after environment]!]

with the cursor highlighting (environment body). You can then TAB to after the environment when you're done.

There is a lot more to explore on the Wiki, https://github.com/erinata/FingerText/wiki.