PyCharm 自定义模版

PyCharm 自定义模板

创建一个新的模板:

  1. 点击 Preferences... 选项或者按下快捷键 Command(⌘) + , 打开设置对话框。
  2. 找到 在 Editor 下的 File and Code Templates 设置页面。
  3. 按下 + ,在 Name: 中填入名称,在 Extension: 中填入后缀名。
  4. 点击 Apply 应用更改,关闭对话框。

另存为一个模板:

  1. 写好模板,点击 Tools 下的 Save File as Template... 选项。
  2. 在弹出的对话框中填写模版民称和后缀名, 应用并关闭对话框。
    之后可以在 File and Code Templates 设置页面找到模板。

复制一个模板:

  1. 找到 File and Code Templates 设置页面。
  2. 选中一个模板,点击复制按钮,就会得到一个复制的模板,可以进行修改。

使用模板 :在创建新文件时找到模板的名称点击它,就可以使用了。

删除模板 :在 File and Code Templates 设置页面点击 - 按钮。

语法:
文件和代码模板是用 Velocity Template Language(VTL) 编写的。


具体查询VTL参考指南
---
参考资料:File and Code Templates - Help | PyCharm

猜你喜欢

转载自www.cnblogs.com/jmtm/p/9916050.html
今日推荐