diff options
| author | Robert Günzler <r@gnzler.io> | 2021-08-30 18:23:43 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2021-08-31 12:41:20 +0200 |
| commit | b84cfc5bceacf0d50a7d8e6fc5946dbbf4f2aa08 (patch) | |
| tree | 2419865d452c1f12f5246f88bcce719f3e068a37 /.vim/lua | |
| parent | 7487344952be827f50bf5bab9fb3091c41001cce (diff) | |
vim: update snips.lua
Diffstat (limited to '.vim/lua')
| -rw-r--r-- | .vim/lua/snips.lua | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/.vim/lua/snips.lua b/.vim/lua/snips.lua index aa7b0bf..b15ffbf 100644 --- a/.vim/lua/snips.lua +++ b/.vim/lua/snips.lua @@ -5,25 +5,33 @@ local system = function(cmd) local args = vim.split(cmd, ' ') local command = args[1] table.remove(args, 1) - return table.concat(require('plenary.job'):new({ + local output = require('plenary.job'):new({ command = command, args = args, enable_recording = true, - }):sync(), '\n') + }):sync() + if #output > 1 then + return table.concat(output, '\n') + else + return output[1] + end end end local U = require'snippets.utils' require('snippets').snippets = { _global = { + today = [[${=os.date("%Y-%m-%d")}]], nowutc = [[${=os.date("!%Y-%m-%dT%H:%M:%SZ")}]], nowloc = [[${=os.date("%Y-%m-%dT%H:%M:%S%z")}]], + me = [[${=io.popen('git config --get user.name'):read"*l"} <${=io.popen('git config --get user.email'):read"*l"}>]], + ok = "✔", bad = "✘", - todo = U.force_comment [[NOTE(${=io.popen("id -un"):read"*l"}): ]], - note = U.force_comment [[TODO(${=io.popen("id -un"):read"*l"}): ]], + todo = U.force_comment [[TODO(${=io.popen("id -un"):read"*l"}): ]], + note = U.force_comment [[NOTE(${=io.popen("id -un"):read"*l"}): ]], }, sh = { -- {{{ @@ -106,4 +114,9 @@ ${0} \end{document} ]], }, -- }}} + + org = { + todo = [[* TODO ]], + note = [[* ]], + } } |