summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.vim/lua/snips.lua21
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 = [[* ]],
+  }
 }