Update UltiSnips snippets for LaTeX and Asciidoctor

For the LaTeX snippets, it simply reflects the personal style guide.
This commit is contained in:
foo-dogsquared 2019-10-26 20:50:41 +08:00
parent 28d6b892b3
commit c5ec2b30df
2 changed files with 30 additions and 6 deletions

View File

@ -22,11 +22,19 @@ snip.rv = "#" * header_level if legit_header_level else ""
$0
endsnippet
snippet tt "Monospace" biw
`$1` $0
snippet bf "Boldface" iw
**$1** $0
endsnippet
snippet hl "Highlighted text" biw
snippet it "Italic" iw
__$1__ $0
endsnippet
snippet tt "Monospace" iw
\`$1\` $0
endsnippet
snippet hl "Highlighted text" iw
#$1# $0
endsnippet
@ -34,11 +42,11 @@ snippet a "Hyperlink" iw
${1:<url>}[${2:<text>}] $0
endsnippet
snippet sp "Superscript" biw
snippet sp "Superscript" iw
^$1^ $0
endsnippet
snippet sb "Subscript" biw
snippet sb "Subscript" iw
~$1~ $0
endsnippet
@ -88,6 +96,22 @@ $1
$0
endsnippet
snippet "-table h (\d+)-" "Make a quick table with the headers already set up" bir
[cols="`!p snip.rv = match.group(1)`", options="headers"]
|===
$1
`!p
number_of_headers = int(match.group(1))
for i in range(0, number_of_headers):
snip.rv += f"| Header {i + 1}\n"
`
$2
|===
$0
endsnippet
# Multimedia blocks
snippet figure "Image block with caption" bi
.${2:<caption>}

View File

@ -128,7 +128,7 @@ endsnippet
# Document structure tags
snippet chapter "Chapter element" bi
\chapter{$1}
\label{ch!$1}
\label{chap!$1}
$0
endsnippet