Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restricting snippets to contexts #19

Closed
medwatt opened this issue Jun 24, 2020 · 2 comments
Closed

Restricting snippets to contexts #19

medwatt opened this issue Jun 24, 2020 · 2 comments

Comments

@medwatt
Copy link

medwatt commented Jun 24, 2020

I'm just wondering if it is possible to make some snippets expand only inside certain contexts. For example, if I type "ahat" inside an equation block or inside $ $, I want it to become \hat{a} but if I type "that" anywhere outside an equation block, I don't want it to become \hat{t} but stay as it is. Is something like this possible?

Here's a page where someone does something like this, but in vim: https://castel.dev/post/lecture-notes-1/#context

@draivin
Copy link
Owner

draivin commented Jun 24, 2020

Unfortunately it is blocked on a vscode issue, you can see some thoughts I had about this over here: #6.

@draivin draivin closed this as completed Jun 24, 2020
@universemaster
Copy link

I have exactly the same use-case as @medwatt - implementing @gillescastel 's snippets in vscode.

Other extensions still use scopes via vscode-textmate see example here: restore-scope.

Can we not use the vscode-textmate module in this extension? Particularly interested in math scopes inside markdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants