search

Home  >  Q&A  >  body text

python - pycharm template 行、块注释快捷键

ubuntu下的
pycharm 在 template 里块注释(快捷键 ctrl+/):

<!--                    <p class="js-header" name="n">名称</p>
                    <p class="js-header" name="pn">商品编号</p>
                    <p class="js-header" name="b">品牌</p>
                    <p class="js-header" name="s">系列</p>
                    <p class="js-header" name="d">上传日期</p>-->

实际上是无效的。

正确注释 template 内块代码的标志为:

{#        <p class="category-title">#}
{#            分类修改记录#}
{#        </p>#}

这才是django的块代码注释方式,
不知在哪里设置该快捷键?

PHPzPHPz2892 days ago561

reply all(5)I'll reply

  • 怪我咯

    怪我咯2017-04-17 17:57:08

    Thanks to the comment area @永中 who can’t learn programming
    The community version does not have this function, and it has nothing to do with the platform.
    Sure enough, this situation only occurs in the community version.

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 17:57:08

    1) First select the block to be commented, then Ctrl + Shift + "/"
    2) Select any line of the block to be commented, Ctrl + "-" to fold the code into one line, then Ctrl + "/" to comment

    reply
    0
  • PHPz

    PHPz2017-04-17 17:57:08

    I make all modifications manually. . . .

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 17:57:08


    Have you chosen this

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 17:57:08

    Django template allows the same comments as python, the commented out html will not be output to the client

    Line comment, cursor to the current line ctrl+/
    Block comment, select the block to be commented ctrl+shift+/

    reply
    0
  • Cancelreply