pycharm模板文件夹中不存在实时模板文件?

时间:2016-07-14 09:30:37

标签: python templates pycharm live-templates

我想插入多个实时模板。例如,每当我键入tab并按<your home directory>\.<product name><version number>\config\templates时,pycharm就会为python编写完整属性。

我想导入以下列表: https://github.com/hoffmann/PyCharm-Python-Templates

但我在{{1}}中找不到模板文件夹,如https://www.jetbrains.com/help/pycharm/2016.1/live-templates.html

中所述

我也在使用社区版2016.1.4。

2 个答案:

答案 0 :(得分:0)

当我使用路径<your home directory>\.PyCharm2018.3\config\jba_config\templates\user.xml(我的PyCharm版本是2018.3.4)时,我在Windows上可以使用它

如果这对您不起作用,则可以按照我的操作找到文件的位置。

  • 在PyCharm中打开File | Settings | Editor | Live Templates,创建一个名为MyNewUniqueLiveTemplate的新模板
  • 在目录<user directory>\.PyCharm2018.3\config的命令行上,“ grep”为字符串MyNewUniqueLiveTemplate

答案 1 :(得分:0)

我遇到了同样的问题,发现有一种插入多个实时模板的最简单方法。

  • 只需从* .XML文件复制所需的模板代码,
  • 打开PyCharm的实时模板设置std::sort(std::begin(a), std::begin(a) + t);
  • 选择模板组(例如(Ctrl+Alt+S -> Editor / Live Templates)或创建自己的模板,例如'Python')
  • 并粘贴值。仅此而已!

无论操作系统,PyCharm版本如何,它都可以正常运行,您不必担心PyCharm配置文件的位置。

您可以通过这种方式一次插入多个实时模板。

相关问题