aboutsummaryrefslogtreecommitdiff
path: root/files/.vim
diff options
context:
space:
mode:
authorAnton Bobov <anton@bobov.name>2024-08-29 00:17:28 +0500
committerAnton Bobov <anton@bobov.name>2024-08-29 00:17:28 +0500
commit6c306d96bb4aa703d40bfa3ddfc3f919ed1127af (patch)
tree294d68c8bf2e34b335ef93ac3f8fa32e214b48d1 /files/.vim
parent456a50528edd2ade497bb0611269189f7d5ef461 (diff)
vim: Update snippets
Diffstat (limited to 'files/.vim')
-rw-r--r--files/.vim/UltiSnips/gitcommit.snippets22
-rw-r--r--files/.vim/UltiSnips/sh.snippets25
2 files changed, 47 insertions, 0 deletions
diff --git a/files/.vim/UltiSnips/gitcommit.snippets b/files/.vim/UltiSnips/gitcommit.snippets
new file mode 100644
index 0000000..8342630
--- /dev/null
+++ b/files/.vim/UltiSnips/gitcommit.snippets
@@ -0,0 +1,22 @@
+# Conventional Commits: https://www.conventionalcommits.org/
+snippet title
+${1|feat,fix,refactor,test,docs,revert,chore,ci,perf,style,build|}: ${3}
+
+${0}
+endsnippet
+
+snippet refs "Add "
+refs #${0:TARGET}
+endsnippet
+
+snippet refst
+refs #$1`git rev-parse --abbrev-ref HEAD | grep -o -E "[0-9]+" | tr -d "\n"`$0
+endsnippet
+
+snippet review
+Reviewed-by: ${1:author} <${2:g:email}>$0
+endsnippet
+
+snippet co
+Co-authored-by: ${1:author} <${2:email}>$0
+endsnippet
diff --git a/files/.vim/UltiSnips/sh.snippets b/files/.vim/UltiSnips/sh.snippets
index 6cedc37..b06337f 100644
--- a/files/.vim/UltiSnips/sh.snippets
+++ b/files/.vim/UltiSnips/sh.snippets
@@ -38,3 +38,28 @@ endsnippet
snippet usage
echo "Usage: ${0##*/}"
endsnippet
+
+snippet colors
+GREEN='\033[0;32m'
+RED='\033[0;31m'
+RESET_COLOR='\033[0m'
+
+echo -e "${GREEN}Yay!${RESET_COLOR}"
+echo -e "${RED}Error!${RESET_COLOR}"
+endsnippet
+
+snippet green
+echo -e "${GREEN}${1}${RESET_COLOR}"
+endsnippet
+
+snippet red
+echo -e "${RED}${1}${RESET_COLOR}"
+endsnippet
+
+snippet main
+main() {
+ $0
+}
+
+main "$@"
+endsnippet