From b818e30a2fbaeaaec4e46745740bb815dbab2b28 Mon Sep 17 00:00:00 2001 From: foo-dogsquared Date: Fri, 20 Dec 2019 10:44:54 +0800 Subject: [PATCH] Update UltiSnips snippets --- vim/.vim/own-snippets/all.snippets | 34 +++++++++++++++++++ vim/.vim/own-snippets/asciidoc.snippets | 44 +++++++++++++++++++++++-- vim/.vim/own-snippets/snippets.snippets | 2 +- 3 files changed, 76 insertions(+), 4 deletions(-) diff --git a/vim/.vim/own-snippets/all.snippets b/vim/.vim/own-snippets/all.snippets index f3d22fb..06dbd94 100644 --- a/vim/.vim/own-snippets/all.snippets +++ b/vim/.vim/own-snippets/all.snippets @@ -29,3 +29,37 @@ ${2:Gabriel Arazas} $0 endsnippet +snippet ie "Parenthetical material Latin 'id est' (ie)" iw +(i.e., $1) $0 +endsnippet + +snippet eg "Parenthetical material Latin 'exempli gratia' (eg)" iw +(e.g., $1) $0 +endsnippet + +snippet em "Quick em dash" +— +endsnippet + +snippet em-mat "Em dash material" iw +— $1 — $0 +endsnippet + +snippet em-ie "'id est' surrounded with em dash" iw +— i.e., $1 — $0 +endsnippet + +snippet em-eg "'exempli gratia' surrounded with em dash" iw +— e.g., $1 — $0 +endsnippet + +# Quick word snippets +# Each of these quick word snippets has a prefix of `qw-` +snippet qw-lx "LaTeX" iw +LaTeX +endsnippet + +snippet qw-as "Asciidoctor" iw +Asciidoctor +endsnippet + diff --git a/vim/.vim/own-snippets/asciidoc.snippets b/vim/.vim/own-snippets/asciidoc.snippets index a643a05..386f733 100644 --- a/vim/.vim/own-snippets/asciidoc.snippets +++ b/vim/.vim/own-snippets/asciidoc.snippets @@ -12,16 +12,32 @@ def smart_space(next_str, auto_str=" ", loose=False): endglobal # Text formatting -snippet "h(\d)" "Quick header snippet" biw +snippet "h(\d)" "Quick header snippet" bir `!p header_level = int(match.group(1)) legit_header_level = True if header_level >= 1 and header_level <= 6 else False -snip.rv = "#" * header_level if legit_header_level else "" +snip.rv = "=" * header_level if legit_header_level else "" ` $0 endsnippet +snippet ch "Chapter header" bi + + + + +== $1 + +$0 +endsnippet + +snippet "sh(\d)" "Section header" bir + + +`!p snip.rv = "=" * int(match.group(1))` +endsnippet + snippet bf "Boldface" iw **$1** $0 endsnippet @@ -79,7 +95,7 @@ $0 endsnippet snippet src "Source code listings" bi -[source,${1:}] +[source, ${1:}] ---- ${2:} ---- @@ -171,3 +187,25 @@ snippet abstract "Abstract block" bi $0 endsnippet +snippet append "Appendix block" bi +[appendix] +== ${1:Appendix} +$0 +endsnippet + +snippet stem "Stem block" bi +[stem] +++++ +$1 +++++ +$0 +endsnippet + +snippet mstem "Stem macro" iw +stem:[$1] $0 +endsnippet + +snippet foot "Footnote macro" iw +footnote:[$1] $0 +endsnippet + diff --git a/vim/.vim/own-snippets/snippets.snippets b/vim/.vim/own-snippets/snippets.snippets index 54afb72..98164cb 100644 --- a/vim/.vim/own-snippets/snippets.snippets +++ b/vim/.vim/own-snippets/snippets.snippets @@ -1,5 +1,5 @@ snippet usnip "A working snippet for creating UltiSnips snippets" ib -`!p snip.rv = "snippet"` ${1:} ${2:} ${3:} +`!p snip.rv = "snippet"` ${1:} "${2:}" ${3:} $4 `!p snip.rv = "endsnippet"` $0