Created
November 28, 2019 07:18
-
-
Save codethereforam/c1f362676b753b494a815249fbccca94 to your computer and use it in GitHub Desktop.
idea live template个人配置
This file contains 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
<templateSet group="user"> | |
<template name="odc" value="<choose> <when test="orderByClause != null"> order by ${orderByClause} </when> <otherwise> $CLIPBOARD$ </otherwise> </choose>" description="" toReformat="true" toShortenFQNames="true"> | |
<variable name="CLIPBOARD" expression="clipboard()" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="SQL_STATEMENT" value="true" /> | |
<option name="SQL_STATEMENT_MEMSQL" value="true" /> | |
<option name="SQL_STATEMENT_MYSQL" value="true" /> | |
</context> | |
</template> | |
<template name="odcx" value="<if test="orderByClause != null"> order by ${orderByClause} </if>" description="" toReformat="false" toShortenFQNames="false"> | |
<context> | |
<option name="SQL_STATEMENT" value="true" /> | |
<option name="SQL_STATEMENT_MEMSQL" value="true" /> | |
<option name="SQL_STATEMENT_MYSQL" value="true" /> | |
</context> | |
</template> | |
<template name="mli" value="<if test="$FIELD1$ != null"> <choose> <when test="$FIELD2$.size() == 1"> <bind name="$FIELD5$likeValue" value="$FIELD3$[0] + '%'" /> AND LIKE #{$FIELD6$likeValue} </when> <otherwise> and in <foreach collection="$FIELD4$" open="(" close=")" item="item" separator=","> #{item} </foreach> </otherwise> </choose> </if>" description="" toReformat="true" toShortenFQNames="true"> | |
<variable name="FIELD1" expression="clipboard()" defaultValue="" alwaysStopAt="true" /> | |
<variable name="FIELD2" expression="clipboard()" defaultValue="" alwaysStopAt="true" /> | |
<variable name="FIELD5" expression="clipboard()" defaultValue="" alwaysStopAt="true" /> | |
<variable name="FIELD3" expression="clipboard()" defaultValue="" alwaysStopAt="true" /> | |
<variable name="FIELD6" expression="clipboard()" defaultValue="" alwaysStopAt="true" /> | |
<variable name="FIELD4" expression="clipboard()" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="SQL_ALL" value="true" /> | |
<option name="SQL_MEMSQL" value="true" /> | |
<option name="SQL_MYSQL" value="true" /> | |
<option name="SQL_STATEMENT" value="false" /> | |
<option name="SQL_STATEMENT_MEMSQL" value="false" /> | |
<option name="SQL_STATEMENT_MYSQL" value="false" /> | |
</context> | |
</template> | |
<template name="lik" value="<if test="$V1$ != null"> <bind name="$V2$Like" value="$V3$ + '%'" /> AND $END$ LIKE #{$V4$Like} </if>" description="" toReformat="true" toShortenFQNames="true"> | |
<variable name="V1" expression="clipboard()" defaultValue="" alwaysStopAt="true" /> | |
<variable name="V2" expression="clipboard()" defaultValue="" alwaysStopAt="true" /> | |
<variable name="V3" expression="clipboard()" defaultValue="" alwaysStopAt="true" /> | |
<variable name="V4" expression="clipboard()" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="SQL_ALL" value="true" /> | |
<option name="SQL_MEMSQL" value="true" /> | |
<option name="SQL_MYSQL" value="true" /> | |
<option name="SQL_STATEMENT" value="false" /> | |
<option name="SQL_STATEMENT_MEMSQL" value="false" /> | |
<option name="SQL_STATEMENT_MYSQL" value="false" /> | |
</context> | |
</template> | |
<template name="ift" value="<if test="$CB1$ != null">and $END$ = #{$CB2$}</if>" description="" toReformat="true" toShortenFQNames="true"> | |
<variable name="CB1" expression="clipboard()" defaultValue="" alwaysStopAt="true" /> | |
<variable name="CB2" expression="clipboard()" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="SQL_STATEMENT" value="true" /> | |
<option name="SQL_STATEMENT_MEMSQL" value="true" /> | |
<option name="SQL_STATEMENT_MYSQL" value="true" /> | |
</context> | |
</template> | |
<template name="cv" value="$CLIPBOARD$" description="" toReformat="false" toShortenFQNames="true"> | |
<variable name="CLIPBOARD" expression="groovyScript("Arrays.stream(_1.split(',')).map({ s ->if (s.contains(' ')) {return s} else{ return s + ' ' + s.tokenize('.')[-1].replaceAll(/_\\w/) { it[1].toUpperCase() }}}).collect(java.util.stream.Collectors.joining(', '))", clipboard())" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="OTHER" value="true" /> | |
</context> | |
</template> | |
<template name="psvm" value="public static void main(String[] args){ $END$ }" description="main() method declaration" toReformat="true" toShortenFQNames="true" /> | |
<template name="*" value="* * * @author yanganyu * @date $date$ $time$ $params$ * @return {@code $returnValue$} */ " description="my annotation" toReformat="true" toShortenFQNames="true"> | |
<variable name="date" expression="date()" defaultValue="" alwaysStopAt="false" /> | |
<variable name="time" expression="time()" defaultValue="" alwaysStopAt="false" /> | |
<variable name="params" expression="groovyScript("if(\"${_1}\".length() == 2) {return '';} else {def result=''; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {result+=' * @param ' + params[i] + ' ' + params[i] + ((i < params.size() - 1) ? '\\n' : '')}; return result}", methodParameters())" defaultValue="" alwaysStopAt="false" /> | |
<variable name="returnValue" expression="methodReturnType()" defaultValue="" alwaysStopAt="false" /> | |
<context> | |
<option name="JAVA_COMMENT" value="true" /> | |
<option name="JAVA_DECLARATION" value="true" /> | |
<option name="JAVA_EXPRESSION" value="true" /> | |
<option name="JAVA_STATEMENT" value="true" /> | |
</context> | |
</template> | |
</templateSet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment