1
0
mirror of https://github.com/amix/vimrc synced 2025-09-15 08:35:01 +08:00

Update vim-snippets.

This commit is contained in:
Kurtis Moxley
2022-05-19 22:57:32 +08:00
parent 421583d7d6
commit 5608a81ee4
24 changed files with 962 additions and 263 deletions

View File

@ -1,4 +1,15 @@
# https://www.conventionalcommits.org/en/v1.0.0-beta.2/#specification
global !p
def complete(t, opts):
if t:
opts = [ m[len(t):] for m in opts if m.startswith(t) ]
if len(opts) == 1:
return opts[0]
return '(' + '|'.join(opts) + ')'
endglobal
snippet status "Status" bA
status $1`!p snip.rv = complete(t[1], ['build', 'ci', 'test', 'refactor', 'perf', 'improvement', 'docs', 'chore', 'feat', 'fix'])`
endsnippet
snippet fix "fix conventional commit"
fix(${1:scope}): ${2:title}
@ -59,3 +70,61 @@ build(${1:scope}): ${2:title}
${0:${VISUAL}}
endsnippet
snippet sign "Signature"
-------------------------------------------------------------------------------
${1:Company Name}
${2:Author Name}
${3:Streetname 21}
${4:City and Area}
${5:Tel: +44 (0)987 / 888 8888}
${6:Fax: +44 (0)987 / 888 8882}
${7:Mail: Email}
${8:Web: https://}
-------------------------------------------------------------------------------
$0
endsnippet
snippet t "Todo"
TODO: ${1:What is it} (`date "+%b %d %Y %a (%H:%M:%S)"`, `echo $USER`)
$0
endsnippet
snippet cmt "Commit Structure" bA
${1:Summarize changes in around 50 characters or less}
${2:More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of the commit and the rest of the text as the body. The
blank line separating the summary from the body is critical (unless
you omit the body entirely); various tools like `log`, `shortlog`
and `rebase` can get confused if you run the two together.}
${3:Explain the problem that this commit is solving. Focus on why you
are making this change as opposed to how (the code explains that).
Are there side effects or other unintuitive consequences of this
change? Here's the place to explain them.}
${4:Further paragraphs come after blank lines.
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, preceded
by a single space, with blank lines in between, but conventions
vary here}
${5:Status}
${6:If you use an issue tracker, put references to them at the bottom,
like this.}
${7:Any todos}
${8:Resolves: #123
See also: #456, #789}
${9:Signature}
endsnippet