Andrii Zarubin
Andrii Zarubin

Reputation: 2255

Sublime text 2 snippets

Is there any way to access current scope (class name or function name) inside a snippet? I am trying to write a snippet for super(CurrentClassName, self).get(*args, **kwargs) but seems like I can't really replace CurrentClassName with actual class name. Does anyone know how to do that?

Upvotes: 0

Views: 359

Answers (2)

taman
taman

Reputation: 347

For future Googlers, someone has made such a plugin:

https://github.com/rubyruy/SuperPython

Upvotes: 0

Eiyrioü von Kauyf
Eiyrioü von Kauyf

Reputation: 4735

Sorry snippets are primarily meant for reusability; you can do precisely as you say above but cannot insert specific things - you would have to write your own plugin in order to add this functionality as it would require things like a specific way of selecting things to modify and replace which would be specific to it.

Upvotes: 1

Related Questions