Note that the builtin language support extension for VS Code support wrapping the selected text like $selection$ if you press $ while text is selected (see the surroundingPairs property in https://github.com/microsoft/vscode/blob/main/extensions/latex/latex-language-configuration.json). So all that's missing is the case when there's nothing selected (which would have been the autoClosingPairs if it was implemented builtin).
Using keyboard shortcuts
You can kind of hack this by defining a keybinding that types out the dollars and then just moves the caret left (put this in your keybindings.json (run Preferences: Open Keyboard Shortcuts (JSON) in the command palette)):
{
"key": "shift+4", // or whatever it is on your keyboard layout
"command": "runCommands",
"args": {
"commands": [
{
"command": "type",
"args": {"text": "$$" },
},
"cursorLeft",
],
},
"when": "editorTextFocus && (!editorHasSelection) && (editorLangId == latex || editorLangId == tex)"
},
Honestly, I think using shift+4 will get annoying when you actually want to type just a single dollar (I wager you'll get annoyed enough by it to change it to something else), which is probably why it's not builtin to VS Code in the autoClosingPairs property.
Using user snippets
You could take a different approach and just use user snippets, putting something like this in your snippets file (use the Snippets: Configure User Snippets command in the command palette):
"dollar math": {
"scope": "tex,latex",
"prefix": "dm", // this is what you type in the editor to get the snippet suggestion
"body": ["\\$$1\\$"],
},
Sidenote: This feature-request has been brought up several times in one of the popular LaTeX extension for VS Code: https://github.com/James-Yu/LaTeX-Workshop/issues/968, https://github.com/James-Yu/LaTeX-Workshop/issues/544, https://github.com/James-Yu/LaTeX-Workshop/issues/235. Every time, it's declined (fine- I totally respect that), with the message:
Please up vote microsoft/vscode/issues/38352.
Which would allow users to configure auto-closing brackets at the user-level.
I haven't tried this, but you could potentially edit the various *-language-configuration.json files in your installation of this extension (look under its syntax/ subdirectory). Extensions are typically installed to the .vscode/extensions/ directory in your user home directory. The property you'd want to edit is autoClosingPairs for whichever of the multiple language configuration files you want to change.
Technically you could do the same thing for modifying the builtin language configuration JSON files for LaTeX in your VS Code installation, but VS Code would probably start issuing a corruption warning once you do that.
\[ ... \]. – Ulrike Fischer Sep 03 '21 at 16:33\[...\]. See Why is\[...\]preferable to$$...$$? – Werner Sep 03 '21 at 16:33\(...\)as an alternative. – Werner Sep 03 '21 at 17:32$...$as something you wanted auto-closed, but recently changed to recognize$...$as something you wanted auto-closed, and you could like to change it back. Is that correct? – Teepeemm Sep 03 '21 at 17:48