zoukankan      html  css  js  c++  java
  • sublime插件时间

    1. import datetime  
    2. import sublime_plugin  
    3. class AddCurrentTimeCommand(sublime_plugin.TextCommand):  
    4.     def run(self, edit):  
    5.         self.view.run_command("insert_snippet",   
    6.             {  
    7.                "contents": "--[[--"" "  
    8.                 " * @Description: ${1:Description}"" "  
    9.                 " * @Author:      JuhnXu"" "  
    10.                 " * @DateTime:    "  "%s"  %datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") +" "  
    11.                 " ]]"                  
    12.             }  
    13.         )  
    14. class AddFuncCommand(sublime_plugin.TextCommand):  
    15.     def run(self, edit):  
    16.         self.view.run_command("insert_snippet",   
    17.             {  
    18.                "contents": "--[[--"" "  
    19.                 " * @Description: ${1:desc}  "" "  
    20.                 " * @param:       ${2:string} ${3:name} "" "  
    21.                 " * @return:      ${4:nil}" " "  
    22.                 " ]]"                  
    23.             }  
    24.         )  

    按键映射

    [plain] view plain copy
     
    1. [  
    2.     {  
    3.         "command": "add_current_time",  
    4.         "keys": [  
    5.             "alt+shift+j"  
    6.         ]  
    7.     },  
    8.     {  
    9.         "command": "add_func",  
    10.         "keys": [  
    11.             "alt+shift+k"  
    12.         ]  
    13.     }  
    14.   
    15.   
    16. ]  

    import datetime
    import sublime_plugin
    class AddCurrentTimeCommand(sublime_plugin.TextCommand):
    def run(self, edit):
    self.view.run_command("insert_snippet",
    {
    "contents": "/**"" "
    " * @Description: "" "
    " * @Author: "" "
    " * @DateTime: ""%s" %datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") +" "
    " */"
    }
    )
    class AddFuncCommand(sublime_plugin.TextCommand):
    def run(self, edit):
    self.view.run_command("insert_snippet",
    {
    "contents": "/**"" "
    " * @Description: "" "
    " * @table: "" "
    " * @param: "" "
    " * @param: "" "
    " * @return: "" "
    " * @DateTime: ""%s" %datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") +" "
    " */"
    }
    )

  • 相关阅读:
    工具类官网Web原型制作分享-Adobe
    还在为黑白网页设计犯难?12款设计帮你轻松解决!!!
    联系我们吧
    单调栈&&单调队列
    *模板--数据结构
    非递归线段树专题
    反素数
    线段树专题训练
    BST
    排列与组合
  • 原文地址:https://www.cnblogs.com/brady-wang/p/5408032.html
Copyright © 2011-2022 走看看