sublime插件时间
- import datetime
- import sublime_plugin
- class AddCurrentTimeCommand(sublime_plugin.TextCommand):
- def run(self, edit):
- self.view.run_command("insert_snippet",
- {
- "contents": "--[[--""\n"
- " * @Description: ${1:Description}""\n"
- " * @Author: JuhnXu""\n"
- " * @DateTime: " "%s" %datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") +"\n"
- " ]]"
- }
- )
- class AddFuncCommand(sublime_plugin.TextCommand):
- def run(self, edit):
- self.view.run_command("insert_snippet",
- {
- "contents": "--[[--""\n"
- " * @Description: ${1:desc} ""\n"
- " * @param: ${2:string} ${3:name} ""\n"
- " * @return: ${4:nil}" "\n"
- " ]]"
- }
- )
按键映射
- [
- {
- "command": "add_current_time",
- "keys": [
- "alt+shift+j"
- ]
- },
- {
- "command": "add_func",
- "keys": [
- "alt+shift+k"
- ]
- }
- ]
import datetime
import sublime_plugin
class AddCurrentTimeCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.run_command("insert_snippet",
{
"contents": "/**""\n"
" * @Description: ""\n"
" * @Author: ""\n"
" * @DateTime: ""%s" %datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") +"\n"
" */"
}
)
class AddFuncCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.run_command("insert_snippet",
{
"contents": "/**""\n"
" * @Description: ""\n"
" * @table: ""\n"
" * @param: ""\n"
" * @param: ""\n"
" * @return: ""\n"
" * @DateTime: ""%s" %datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") +"\n"
" */"
}
)
相关文章
- Vscode插件安利--TerosHDL
- Eclipse中SVN插件的基本使用「建议收藏」
- 【CSDN浏览器插件测评超详细版】——万能便捷的C功能,直接爱不释手,强烈推荐!更多功能等你探索
- CAD插件-迷你建筑工具箱免费下载及安装教程 pdf编辑器全版本下载
- (十三)Vuex 插件系统
- 【Visual Studio 2019】上传代码到 GitHub ( 16.9.2 版本 | 安装 GitHub 扩展插件 | 创建 Git 仓库 | 推送到远程仓库 )
- 【Android Gradle 插件】ProductFlavor 配置 ( ProductFlavor#resValue 方法 | ProductFlavor#dimension 维度属性 )
- WordPress Adsense 管理插件:Adsense Manager
- WordPress Feed 聚合插件:Feeder
- 破解Redis插件开启更多精彩之旅(破解redis插件)
- fancybox1.3.1基于Jquery的插件在IE中图片显示问题
- jQuery插件开发全解析
- JS替换和时间插件的结合使用方法