From 6c306d96bb4aa703d40bfa3ddfc3f919ed1127af Mon Sep 17 00:00:00 2001 From: Anton Bobov Date: Thu, 29 Aug 2024 00:17:28 +0500 Subject: vim: Update snippets --- files/.vim/UltiSnips/gitcommit.snippets | 22 ++++++++++++++++++++++ files/.vim/UltiSnips/sh.snippets | 25 +++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 files/.vim/UltiSnips/gitcommit.snippets (limited to 'files/.vim') 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 -- cgit v1.2.3