PyCharm 中是否有 HTML 块 {%%} 的快捷方式? [英] Is there a shortcut for HTML blocks {%%} in PyCharm?

查看:26
本文介绍了PyCharm 中是否有 HTML 块 {%%} 的快捷方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常使用像 {% block content %} 这样的 HTML 块,但是必须输入括号和百分比符号很麻烦.有没有捷径或其他方法可以自动执行此操作?

到目前为止我才发现这个:

  • 从列表中选择名称后按Enter(或单击),插入模板.

  • 您可以在 File > Settings > 找到 block 模板. 编辑器 > 实时模板 > Django > .(如果您想

  • I am using HTML blocks like {% block content %} frequently but having to type out the brackets and percentage symbols is a hassle. Is there a shortcut or other way to automate this?

    So far I just found this: Is there a shortcut to insert {%%} in PyCharm? with no good answer.

    解决方案

    There is a Live Template for {% code block %}.

    1. Press Ctrl + J (or go to Code > Insert Live Template).

    2. Start typing block (the name of the template) to filter the list.

    3. Press Enter (or click) after selecting the name from the list, and the template is inserted.

    4. You can find the block template at File > Settings > Editor > Live Templates > Django > block. (In case you want to Configure the Live Template).

    这篇关于PyCharm 中是否有 HTML 块 {%%} 的快捷方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆