login每天学习一点点,每天进步一点点.
当前位置:首页 >> sublime插件-快速插入文件头部作者信息

sublime插件-快速插入文件头部作者信息

2015-12-29 22:18:24  |  分类: Other |  标签: Sublime  阅读(317)评论(0)

新建保存为Sublime Text 2\Packages\User\addInfo.py    或者addinfo1.py

import datetime
import sublime_plugin
class AddInfoCommand(sublime_plugin.TextCommand):
  def run(self, edit):
    self.view.run_command("insert_snippet",
      {
        "contents": "#!/usr/bin/env python""\n"
        "# -*- coding: utf-8 -*-""\n"
        "# @Author  : c32 (amd5@qq.com)""\n"
        "# @Blog    : http://cx7863.blog.163.com/""\n"
        "# @Version : ""\n"
        "# @DateTime:  "  "%s"  %datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") +"\n"
        ""
      }
    )


创建快捷键:

Preference → Key Bindings - User:

[
    {"command": "add_info","keys": ["ctrl+shift+,"]}
]


上一篇:ubuntu使用nmap查询端口 下一篇:ThinkPHP5 的视图$view->fetch()和$view->display()的区别

猜你喜欢

发表评论:

0.304613s