Last active
January 8, 2025 09:38
-
-
Save theY4Kman/ac979bd77f017f162bac53493c0948b9 to your computer and use it in GitHub Desktop.
These are some PyCharm live templates which expand into some convenient Python statements, made even easier with context-sensitive autocomplete.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template name="ds" value="$DICT$[['$VAR$'] = $VAR$" description="dict['variable'] = variable" toReformat="false" toShortenFQNames="true"> | |
| <variable name="DICT" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <context> | |
| <option name="Python" value="true" /> | |
| </context> | |
| </template> | |
| <template name="paren" value="$END$($SELECTION$)" description="Function call parentheses" toReformat="false" toShortenFQNames="true"> | |
| <context> | |
| <option name="OTHER" value="true" /> | |
| </context> | |
| </template> | |
| <template name="odv" value="'$KEY$': $OBJ$.$VAR$," description="'var': object.var," toReformat="false" toShortenFQNames="true"> | |
| <variable name="OBJ" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <variable name="KEY" expression="VAR" defaultValue="" alwaysStopAt="false" /> | |
| <context> | |
| <option name="Python" value="true" /> | |
| </context> | |
| </template> | |
| <template name="logger" value="logger = logging.getLogger(__name__)" description="logger = logging.getLogger(__name__)" toReformat="false" toShortenFQNames="true"> | |
| <context> | |
| <option name="Python" value="true" /> | |
| </context> | |
| </template> | |
| <template name="se" value="self.$KEY$ = $VAR$" description="self.var = var" toReformat="false" toShortenFQNames="true"> | |
| <variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <variable name="KEY" expression="VAR" defaultValue="" alwaysStopAt="false" /> | |
| <context> | |
| <option name="Python" value="true" /> | |
| </context> | |
| </template> | |
| <template name="name" value="__name__" description="__name__" toReformat="false" toShortenFQNames="true"> | |
| <context> | |
| <option name="Python" value="true" /> | |
| </context> | |
| </template> | |
| <template name="sdv" value="'$KEY$': self.$VAR$," description="'var': self.var," toReformat="false" toShortenFQNames="true"> | |
| <variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <variable name="KEY" expression="VAR" defaultValue="" alwaysStopAt="false" /> | |
| <context> | |
| <option name="Python" value="true" /> | |
| </context> | |
| </template> | |
| <template name="ua" value="<a href="{% url $URL$ %}">$TEXT$</a>" description="Anchor to reversed Django URL" toReformat="false" toShortenFQNames="true"> | |
| <variable name="URL" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <variable name="TEXT" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <context> | |
| <option name="Django" value="true" /> | |
| </context> | |
| </template> | |
| <template name="skw" value="self.$KEY$ = kwargs.pop('$VAR$')" description="self.var = kwargs.pop('var')" toReformat="false" toShortenFQNames="true"> | |
| <variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <variable name="KEY" expression="VAR" defaultValue="" alwaysStopAt="false" /> | |
| <context> | |
| <option name="Python" value="true" /> | |
| </context> | |
| </template> | |
| <template name="dv" value="'$KEY$': $VAR$," description="'var': var," toReformat="false" toShortenFQNames="true"> | |
| <variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <variable name="KEY" expression="VAR" defaultValue="" alwaysStopAt="false" /> | |
| <context> | |
| <option name="Python" value="true" /> | |
| </context> | |
| </template> | |
| <template name="init" value="def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) $END$" description="__init__ boilerplate" toReformat="false" toShortenFQNames="true"> | |
| <context> | |
| <option name="Python" value="true" /> | |
| </context> | |
| </template> | |
| <template name="xxx" value="#XXX######################################################################################" description="Testing marker line" toReformat="false" toShortenFQNames="true"> | |
| <context> | |
| <option name="Bash" value="true" /> | |
| <option name="CoffeeScript" value="true" /> | |
| <option name="Python" value="true" /> | |
| </context> | |
| </template> | |
| <template name="log" value="console.log('$END$'); //XXX//////////////////////////////////////////////////////////////////////////////" description="console.log" toReformat="false" toShortenFQNames="true"> | |
| <context> | |
| <option name="JAVA_SCRIPT" value="true" /> | |
| </context> | |
| </template> | |
| <template name="kw" value="$KEY$=$VAR$, " description="kwarg = variable," toReformat="false" toShortenFQNames="true"> | |
| <variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <variable name="KEY" expression="VAR" defaultValue="" alwaysStopAt="false" /> | |
| <context> | |
| <option name="Python" value="true" /> | |
| </context> | |
| </template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment