Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Programmable snippets #109

Closed
ZehCnaS34 opened this issue Feb 19, 2015 · 13 comments
Closed

Programmable snippets #109

ZehCnaS34 opened this issue Feb 19, 2015 · 13 comments

Comments

@ZehCnaS34
Copy link

Just wondering if there is any way to make programmable snippets like in yasnippets for emacs.

Kinda like:

var BrowserWindow = require('browser-window');

In this example, when typing BrowserWindow the text inside the require statement is converted from camel case browser-window

This would be awesome.

Anyway I could help?

@thomasjo
Copy link

The desired behavior is known as transformations in TextMate snippet terminology. We should probably use that as the starting point for this feature request.

@ZehCnaS34
Copy link
Author

Alright, sounds good. I'll starting looking at the spec.

@ZehCnaS34 ZehCnaS34 reopened this Feb 19, 2015
@tregusti

This comment has been minimized.

2 similar comments
@rossmcf

This comment has been minimized.

@nweldev

This comment has been minimized.

@paukul

This comment has been minimized.

1 similar comment
@daimon99

This comment has been minimized.

@skaldarnar
Copy link

Any news on this, or any guidance where to start looking at?

@dogancana

This comment has been minimized.

@johnbhurst
Copy link

Rather than use regular expression-based TextMate-style transformations, it might be more flexible to allow calling some kind of user-defined function.

This would allow for regular expressions, but also other things.

I've used this kind of feature in the past in another editor to insert the current date/time, or the current file name, as part of my snippet.

@savetheclocktower
Copy link
Contributor

I wrote up #257 because I’d missed this one way back in the issues list, but I’m linking it here because it’s got some example use cases and some technical discussion.

@gerarts

This comment has been minimized.

@savetheclocktower
Copy link
Contributor

I’m closing this one because the example described can be done now — #260 added support for snippet transformations.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests