3

How to create a yasnippet snippet which is available in all modes?
Lets say I have a function which evaluates the sexpr before the cursor and replaces is with its value, Link to code.
Also I caught me to regular use following sexpr (format "0x%x" ${1:number}) which prints a number in hex. Converting this into a snippet is easy, but:

Question: How can I tell yasnippet, to make it available in every major-mode?

Note: I read the question about multiple modes, but this seems to be much work and fiddling and I would have to create a directory in snippets-dir for every possible mode.

2
  • I don't have a solution with yasnippet. yankpad might come in handy here. Besides you can switch category (mode) very easily with it.
    – DJJ
    Commented Feb 15, 2018 at 20:12
  • @DJJ thanks. I don't think this will work for me, because I'm using company in conjunction with :with yasnippet to auto complete these snippets. :)
    – jue
    Commented Feb 21, 2018 at 23:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.