nvim-config

Log | Files | Refs | Submodules | README

commit b718fe925c82ff25040f49e0585ea95871b67754
parent 077deeda5fecb8ced6ccaf862ea28627560e82be
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date:   Sat, 15 Oct 2022 08:14:33 +0200

luasnip: add more commit lines

Diffstat:
Mlua/completree-config.lua | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/lua/completree-config.lua b/lua/completree-config.lua @@ -103,6 +103,12 @@ local function convcommit_snippet(type) } end +local function commit_line(args, parent, ty) + local gitname = (vim.fn.systemlist { "git" , "config", "user.name" })[1] + local gitmail = (vim.fn.systemlist { "git" , "config", "user.email" })[1] + return string.format("%s: %s <%s>", ty, gitname, gitmail) +end + local comment_tag = (function() local regex_escape = { ["-"] = "%-", @@ -138,6 +144,9 @@ ls.add_snippets('gitcommit', { s({ trig = "coauth", name = "Co Author", dscr = "A git co-author" }, { t "Co-authored-by: ", i(1, "name"), t " <", i(2, "email"), t ">" }), + s({ trig = "ack", name = "Acked-by line" }, { + f(commit_line, {}, { user_args = { "Acked-by" } }) + }), s({ trig = "fix", name = "Fix message", dscr = "Fix without scope or breaking" }, convcommit_snippet "fix"), s({ trig = "feat", name = "Feature message", dscr = "Feature without scope or breaking" }, convcommit_snippet "feat"), s({ trig = "chore", name = "Chore change", dscr = "An update or whatever" }, convcommit_snippet "chore")