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

Include external files in .hsnips #124

Open
DedZago opened this issue Jun 24, 2022 · 0 comments
Open

Include external files in .hsnips #124

DedZago opened this issue Jun 24, 2022 · 0 comments

Comments

@DedZago
Copy link

DedZago commented Jun 24, 2022

Hello, I was wondering whether it would be possible to include external files in .hsnips file, so that we avoid copy-pasting when multiple filetypes share the same snippets.
UltiSnips does this via the use of the extends keyword.

Use case: I have the same mathematical snippets for both quarto files (quarto.hsnips) and RMarkdown files (rmd.hsnips). It would be nice to be able to create an external math.hsnips file to contain the snippets that are shared between them:

math.hsnips:

# Mathematical snippets that are shared between multiple filetypes
snippet dm "math" iA
\[
    $1
\]$0
endsnippet

rmd.hsnips:

# Snippets that are specific for RMarkdown
#...

extends math

quarto.hsnips:

# Snippets that are specific for quarto
#...

extends math

Thank you for your time.

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

1 participant