[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Including Yasnippet to Emacs
From: |
Danil Orlov |
Subject: |
Including Yasnippet to Emacs |
Date: |
Mon, 17 Mar 2014 06:10:12 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
I know that everybody want to push to Emacs standard distro something what he
needs. But snippets is another
question - it is too wide used technology to be ignored. Sublime Text Editor,
TextMate has it, all Jetbrains IDEs has it, I even
think that every IDE nowdays has it. That's bad argument, but I have another
one - lots of modes creates its own wheel to support snippets.
html-mode uses own snippets for tags
web-mode uses own snippets "C-c C-s"
markdown-mode uses own snippets for headers
and that's only modes I use.
I think that if Emacs will have unified mechanism for managing snippets, it
will be useful not only for end users, but also for mode creators.
And those snippets-for-each-mode also steal keybindings. And many of us uses
Yasnippet too, so we in fact always have two different snippet engines.
Of course now Yasnippet probably a bit clumsy for usage via API. Maybe
something like this must be supported, to migrate mode snippets easily.
(yas/api-add-snippet
"html-mode" ; mode
"h1" ; name and key
"C-x n 1" ; keyboard shortcut
"<h1>$1</h1>" ; snippet body
)
So you, as mode author, must not think about bindings, creating function for
each snippet.
What do you think about it?
- Including Yasnippet to Emacs,
Danil Orlov <=