Vscode-markdown: Feature request: `tab` to place cursor out of math mode

Created on 9 Jun 2018  路  8Comments  路  Source: yzhang-gh/vscode-markdown

Can pressing the tab key put the cursor to the right of the right $ when it is in the math mode region?
($ ... | ... $ -> (press tab) -> $...$|)

Help wanted Feature

All 8 comments

or option to overwrite the right $ would also be good, the way ) is overwritten when cursor is to the left of ) in vscode. (|) -> (press )) -> )|. Pressing the -> key which is far from the alphabets is time-consuming..

Could you provide an example to make it clearer? I mean some steps like

  1. $some math|$
  2. press tab key
  3. becomes $some math$|

Yes, it's like your steps, alternatively:

  1. $some math|$
  2. press tab key or $ key
  3. becomes $some math$|

Also for tab an extra feature could be:

  1. $som|e math$ (cursor at some position between $$)
  2. press tab key
  3. becomes $some math$|

This could be extended to ** (italics), ** ** (bold), underline, etc.

Small but sweet feature

I found out from this issue that autocomplete pairs can be set by editing the language-configuration.json file of markdown (/usr/share/code/resources/app/extensions/markdown-basics/language-configuration.json). Adding

             {
            "open": "*",
            "close": "*",
            "notIn": [
                "string"
            ]
        },
        {
            "open": "$",
            "close": "$",
            "notIn": [
                "string"
            ]
        }

to autoClosingPairs is a temporary workaround.

I am not sure whether it will cause some problems with display mode $$ math $$.

BTW, you can use the shortcut ctrl+m to toggle math mode.

It seems to work only for single character pairs, setting * and $ as autocomplete pairs allows overwriting the ending character (like vscode does for parenthesis). Yes, I knew that.

I came across a nice extension Leaper. I think it is a good solution.


It seems to conflict with this extension...

Was this page helpful?
0 / 5 - 0 ratings