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

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")--注册输入

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

谷歌拼音使用lua文件添加扩展包实现vscode的代码段功能_第1张图片
属性设置 扩展

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


谷歌拼音使用lua文件添加扩展包实现vscode的代码段功能_第2张图片
image.png
谷歌拼音使用lua文件添加扩展包实现vscode的代码段功能_第3张图片
image.png

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

你可能感兴趣的:(谷歌拼音使用lua文件添加扩展包实现vscode的代码段功能)