mirror of
https://github.com/amix/vimrc
synced 2025-07-12 22:24:59 +08:00
Merge branch 'Linux' of https://github.com/Geezus42/vimrc into Linux
This commit is contained in:
61
sources_non_forked/vim-snippets/UltiSnips/gitcommit.snippets
Normal file
61
sources_non_forked/vim-snippets/UltiSnips/gitcommit.snippets
Normal file
@ -0,0 +1,61 @@
|
||||
# https://www.conventionalcommits.org/en/v1.0.0-beta.2/#specification
|
||||
|
||||
snippet fix "fix conventional commit"
|
||||
fix(${1:scope}): ${2:title}
|
||||
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
snippet feat "feat conventional commit"
|
||||
feat(${1:scope}): ${2:title}
|
||||
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
snippet chore "chore conventional commit"
|
||||
chore(${1:scope}): ${2:title}
|
||||
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
snippet docs "docs conventional commit"
|
||||
docs(${1:scope}): ${2:title}
|
||||
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
snippet improvement "improvement conventional commit"
|
||||
improvement(${1:scope}): ${2:title}
|
||||
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
snippet perf "perf conventional commit"
|
||||
perf(${1:scope}): ${2:title}
|
||||
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
snippet refactor "refactor conventional commit"
|
||||
refactor(${1:scope}): ${2:title}
|
||||
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
snippet test "test conventional commit"
|
||||
test(${1:scope}): ${2:title}
|
||||
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
snippet ci "ci conventional commit"
|
||||
ci(${1:scope}): ${2:title}
|
||||
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
||||
|
||||
snippet build "build conventional commit"
|
||||
build(${1:scope}): ${2:title}
|
||||
|
||||
${0:${VISUAL}}
|
||||
endsnippet
|
@ -1,3 +1,11 @@
|
||||
global !p
|
||||
# Capitalize the first letter without affecting the rest of the letters
|
||||
def capitalize_first(word):
|
||||
if(word):
|
||||
word = word[0].upper() + word[1:]
|
||||
return word
|
||||
endglobal
|
||||
|
||||
# Functional components
|
||||
snippet rfc "react functional component" b
|
||||
import React, {useState} from "react"
|
||||
@ -14,7 +22,7 @@ export default $4`!p snip.rv = snip.basename`
|
||||
endsnippet
|
||||
# React Hooks
|
||||
snippet useS "useState Hook" b
|
||||
const [${1}, set`!p snip.rv=t[1].title()`] = useState(${3:"${4}"})
|
||||
const [${1}, set`!p snip.rv=capitalize_first(t[1])`] = useState(${3:"${4}"})
|
||||
endsnippet
|
||||
snippet useE "useEffect Hook" b
|
||||
useEffect(() => {
|
||||
|
@ -32,3 +32,12 @@ endsnippet
|
||||
snippet fld "type field documentation" b
|
||||
#' @field ${1:name}::${2:Type} ${0:Description}
|
||||
endsnippet
|
||||
|
||||
# Debugging
|
||||
snippet deb "Debugger breakpoint" b
|
||||
Main.@bp
|
||||
endsnippet
|
||||
|
||||
snippet inf "Infiltrator breakpoint" b
|
||||
Main.@infiltrate
|
||||
endsnippet
|
||||
|
@ -8,6 +8,15 @@ snippet #! "#!/usr/bin/env lua" b
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet assert "Assertion" b
|
||||
assert(${1:condition}`!p
|
||||
if t[2]:
|
||||
snip.rv = ", "
|
||||
else:
|
||||
snip.rv = ""
|
||||
`${2:msg})
|
||||
endsnippet
|
||||
|
||||
snippet !fun(ction)?! "New function" br
|
||||
function ${1:new_function}(${2:args})
|
||||
$0
|
||||
|
@ -138,7 +138,7 @@ def format_arg(arg, style):
|
||||
elif style == NORMAL:
|
||||
return ":%s: TODO" % arg
|
||||
elif style == GOOGLE:
|
||||
return "%s (TODO): TODO" % arg
|
||||
return "%s (%s): TODO" % (arg, arg.type or "TODO")
|
||||
elif style == JEDI:
|
||||
return ":type %s: TODO" % arg
|
||||
elif style == NUMPY:
|
||||
|
Reference in New Issue
Block a user