hsnips
hsnips copied to clipboard
Include external files in .hsnips
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.