美文网首页Luacocos2d-Lua
谷歌拼音使用lua文件添加扩展包实现vscode的代码段功能

谷歌拼音使用lua文件添加扩展包实现vscode的代码段功能

作者: 人气小哥 | 来源:发表于2017-09-14 15:17 被阅读46次
function CurrentDateTime()
    currentdate = os.date("%Y-%B-%d")
    weekday = os.date("%A")
    currenttime = os.date("%X")
    mydt = table.concat({"\nDate: ", currentdate, ", ", weekday, "\nTime: ", currenttime, "\n------------------------------\n"}, "")
    return mydt
end

ime.register_command("dt", "CurrentDateTime", "test")--注册输入

保存上面代码段到任意文件
然后谷歌拼音 属性设置 扩展

属性设置 扩展

谷歌输入法 i启动后面的扩展
输入idt


image.png image.png

原文作者:励富军
链接:https://www.zhihu.com/question/21717567/answer/126569842
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

相关文章

网友评论

    本文标题:谷歌拼音使用lua文件添加扩展包实现vscode的代码段功能

    本文链接:https://www.haomeiwen.com/subject/yxedsxtx.html