问题
I wanted to insert multiple live templates. For example whenever I type prop
and press tab
, then pycharm would write the full property for python.
I wanted to import the following list: https://github.com/hoffmann/PyCharm-Python-Templates
But I can not find the templates folder in <your home directory>\.<product name><version number>\config\templates
, as said in https://www.jetbrains.com/help/pycharm/2016.1/live-templates.html
Also I am using the community edition 2016.1.4.
回答1:
I got this to work on Windows when I used the path <your home directory>\.PyCharm2018.3\config\jba_config\templates\user.xml
(my version of PyCharm is 2018.3.4)
In case this doesn't work for you, you may find where the file belong by following what I did.
- Open
File | Settings | Editor | Live Templates
in PyCharm, created a new template calledMyNewUniqueLiveTemplate
- On the command line in the directory
<user directory>\.PyCharm2018.3\config
"grep"ed for the stringMyNewUniqueLiveTemplate
.
回答2:
I've had the same issue and found that there is one simplest way to insert multiple live templates.
- Just copy desired template code from *.XML file,
- open PyCharm's Live Templates Settings
(Ctrl+Alt+S -> Editor / Live Templates)
, - select Template Group (such as
Python
or create your own like a 'user
'), - and paste in the value. That's all!
It works fine dependless of the operating system, PyCharm version and you shouldn't worry about PyCharm config files location.
You can insert in that way multiply live templates at once.
来源:https://stackoverflow.com/questions/38370553/live-templates-file-does-not-exist-in-pycharm-templates-folder