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.

jue
  • 4,476
  • 8
  • 20
  • I don't have a solution with yasnippet. [yankpad](https://github.com/Kungsgeten/yankpad) might come in handy here. Besides you can switch category (mode) very easily with it. – DJJ Feb 15 '18 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 Feb 21 '18 at 23:54

0 Answers0