如何制作PyDev的文件模板? [英] How do I make a file template for PyDev?

查看:340
本文介绍了如何制作PyDev的文件模板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在每个创建的新文件的顶部提供有关许可证,作者等的一些样板信息,但是我找不到要勾选的正确框。

I'd like to have some boilerplate info about license, author, etc. at the top of every new file I create, but I can't find the correct boxes to tick.

基本上,我想创建一个新文件,并且已经填充(顶部)与

Basically, I want to create a new file, and have it already populated (at the top) with

'''
   author: Me
   license: something
   copyright: something
'''

这是否可能?

推荐答案

转到 Windows - >偏好 - > PyDev - >编辑 - >模板

创建新模板:


  • 填写名称与< Empty>

  • 选择编辑器

  • 启用自动插入

  • 添加说明(可选)

  • 以模式

    • 复制您的模板,您可能需要使用一些变量,如 $ {year} $ {cursor} 在结尾。

    • Fill the name with <Empty>
    • choose Editor
    • enable Automatically insert
    • Add a description (optionally)
    • Copy your template in the pattern
      • you might want to use some variables like ${year} and ${cursor} at the end.

      要在文件中添加您的模板:

      To add your template on the file:

      只需在空行上按 Ctrl + Space 在空格之后,选择< Empty> ,它应该将你的模板添加到你的文件中。

      Just press Ctrl+Space on an empty line or after a whitespace and select <Empty> and it should add your template on your file.

      注意:

      您可以根据需要创建多个< Empty> 模板当您在输入一些字母后调用代码完成后,< Empty> 模板将不会显示。

      Note:
      You can create as many <Empty> templates as you want, <Empty> templates won't show up when you've called the code completion after entering some letters.

      这篇关于如何制作PyDev的文件模板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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