Skip to content

Snippet expansion without need for pressing trigger/completion/expansion key #170423

Closed as not planned
@TryerGit

Description

@TryerGit

Consider the following snippet for LaTeX typesetting which puts one into the inline math mode \( | \)

"mm": {
        "prefix": "mm",
        "body": [
            "\\( $1 \\)"
        ],
        "description": "inline math"
}

There should be capability of having this snippet expand automatically if some conditions are met -- these conditions could be that mm is typed at the beginning of a word or beginning of a newline, etc. By automatic, I mean that the user should not be required to press the trigger/completion/expansion key which is at present the Tab key. Needing this extra key press, Tab is the current default behaviour.

Vim along with Ultisnips already provides this feature. For e.g., the equivalent of the snippet above there is:

snippet mm "Inline Math" wA
\\( $1 \\) $0
endsnippet

The options wA mean that the snippet should trigger if mm is typed at the beginning of a word and it expands automatically without needing the pressing of the Tab key.

The use case is that automatic expansion is much faster than having to reach over to any complicated trigger expansion keystrokes and in this particular case, mm is closer to the home row in the keyboard and leads to ability to type closer to the speed of thought.

Thank you.

Metadata

Metadata

Assignees

Labels

*out-of-scopePosted issue is not in scope of VS Codefeature-requestRequest for new features or functionalitysnippets

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions