网站建设合作方案,凡科小程序制作,广州越秀金融大厦,flashfxp上传wordpressintellij注释模板如上所述这里 #xff0c;的IntelliJ的现场模板可以让你轻松地插入预定义的代码片段到你的源代码。 我在下面发布了一些我最常用的模板#xff0c;链接到我在GitHub上的模板文件的完整列表#xff08;作为设置新IntelliJ环境时的参考#xff09;#xff… intellij注释模板 如上所述这里 的IntelliJ的现场模板可以让你轻松地插入预定义的代码片段到你的源代码。 我在下面发布了一些我最常用的模板链接到我在GitHub上的模板文件的完整列表作为设置新IntelliJ环境时的参考以及将IntelliJ设置文件添加到GitHub所采取的步骤。 例如我设置了一个模板以便可以键入test并单击tab它将为我插入以下JUnit代码片段 Test
public void $NAME$() {$END$
} 这是一种JUnit测试方法最初将光标放在“ public void”之后可以键入测试名称。 然后光标跳到{}之间准备开始编写测试。 IntelliJ模板存储在以下位置的user.xml文件中 ~/Library/Preferences/product nameversion number/templates 例如对于IntelliJ13它是 ~/Library/Preferences/IntelliJIdea13/templates/user.xml 下面列出了我的其他一些模板触发器以粗体显示。 为了可以在任何IntelliJ例如工作和家庭上使用这些模板我在GitHub的此处检查了完整的列表。 之前 Before
public void setup() {$END$
} 后 After
public void tearDown() {$END$
} yi fail(Not yet implemented); 聚甲醛 public void $NAME$() {$END$
} 主要 public static void main(String[] args){$END$
}我采取的将IntelliJ设置添加到GitHub的步骤 首先我在GitHub上通过https://github.com/sabram/IntelliJ设置了一个新仓库。 然后我遵循了这个StackOverflow帖子中有关如何将现有非空目录转换为Git工作目录的说明 cd ~/Library/Preferences/IntelliJIdea13
git init
git add templates/user.xml
git commit -m initial version of IntelliJ user.xml
git remote add myIntelliJRepo https://github.com/sabram/IntelliJ.git 在这一点上我遇到一个错误提示我需要先进行git pull。 但是当我做一个 git pull saIntelliJ 我说错了 You asked to pull from the remote saIntelliJ, but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line. 因此我根据此发布内容对.git / config进行了编辑以包括 [branch master]
remote saIntelliJ
merge refs/heads/master 然后我就可以 git pull saIntelliJ
git push -u saIntelliJ master 成功并且可以继续使用git pull和git push而无需每次都指定存储库名称saIntelliJ。 翻译自: https://www.javacodegeeks.com/2014/04/live-templates-in-intellij.htmlintellij注释模板