From 67f893804f46c6b7e882ab78dc4fb6b72ccad8c5 Mon Sep 17 00:00:00 2001 From: foo-dogsquared Date: Sun, 19 Apr 2020 00:43:32 +0800 Subject: [PATCH] Update polybar and UltiSnips snippets --- nvim/own-snippets/all.snippets | 12 +++++++++++- nvim/own-snippets/asciidoc.snippets | 21 +++++++++++++++++---- polybar/config | 14 +++++++++----- 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/nvim/own-snippets/all.snippets b/nvim/own-snippets/all.snippets index f463752..ed042fd 100644 --- a/nvim/own-snippets/all.snippets +++ b/nvim/own-snippets/all.snippets @@ -1,7 +1,7 @@ global !p from datetime import datetime, timedelta -def relative_date(days): +def relative_date(days = 0): time_difference = timedelta(days=int(days)) calculated_date = datetime.today() + time_difference @@ -24,12 +24,18 @@ snip.rv = datetime.today().strftime("%F") ` endsnippet + +# Quick formatting. snippet sign "Quick signature" i ${1:Sincerely,} ${2:Gabriel Arazas} $0 endsnippet +snippet retrieve "Quick retrieval date in informal format" i +(retrieved `!p snip.rv = datetime.today().strftime("%F")`) +endsnippet + snippet ie "Parenthetical material Latin 'id est' (ie)" iw (i.e., $1) $0 endsnippet @@ -38,6 +44,8 @@ snippet eg "Parenthetical material Latin 'exempli gratia' (eg)" iw (e.g., $1) $0 endsnippet + +# Em dashes (I've these dedicated snippets for some reason). snippet em "Quick em dash" — endsnippet @@ -54,6 +62,7 @@ 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 @@ -64,6 +73,7 @@ snippet qw-as "Asciidoctor" iw Asciidoctor endsnippet + # Miscellaneous snippets snippet #! "Quick snippet for a shebang." bi #!${1:/usr/bin/env} ${2:sh} diff --git a/nvim/own-snippets/asciidoc.snippets b/nvim/own-snippets/asciidoc.snippets index 2864174..1bd62b3 100644 --- a/nvim/own-snippets/asciidoc.snippets +++ b/nvim/own-snippets/asciidoc.snippets @@ -121,14 +121,13 @@ $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"] +[cols="`!p snip.rv = match.group(1)`", options="headers"`!p snip.rv=smart_space(t[1], ", ", loose=True)`$1] |=== -$1 `!p number_of_headers = int(match.group(1)) for i in range(0, number_of_headers): - snip.rv += f"| Header {i + 1}\n" + snip += f"| Header {i + 1}" ` $2 @@ -180,6 +179,14 @@ $1 $0 endsnippet +snippet verbatim "Literal text block" bi +.... +$1 +.... +$0 +endsnippet + + snippet sidebar "Sidebar as an open block" bi [sidebar] .${1:} @@ -197,10 +204,16 @@ endsnippet snippet append "Appendix block" bi [appendix] -== ${1:Appendix} +== ${1:Additional readings} $0 endsnippet +snippet bibres "Bibliographical resource in a definition block" bi +${1:<link>}[${2:<title>}] (retrieved ${3:date}):: +${4:<description>} +endsnippet + + snippet stem "Stem block" bi [stem] ++++ diff --git a/polybar/config b/polybar/config index 2025b5a..56ddd5e 100644 --- a/polybar/config +++ b/polybar/config @@ -126,7 +126,7 @@ inherit = module-common-style type = internal/network interface = enp4s0 - interval = 3.0 + interval = 3 format-connected-prefix = "ETH" format-connected-prefix-padding = 1 @@ -134,13 +134,17 @@ format-connected-prefix-background = ${colors.network_module_bg} format-connected-background = ${colors.foreground} format-connected-foreground = ${colors.background} - label-connected = OK + label-connected = "OK" label-connected-padding = 1 - format-disconnected = <label-disconnected> - format-disconnected-background = ${colors.background} + format-disconnected-prefix = "ETH" + format-disconnected-prefix-padding = 1 + format-disconnected-prefix-foreground = ${colors.background} + format-disconnected-prefix-background = ${colors.network_module_bg} + format-disconnected-background = ${colors.foreground} + format-disconnected-foreground = ${colors.background} label-disconnected-padding = 1 - label-disconnected = N/A + label-disconnected = "N/A" label-disconnected-foreground = ${colors.foreground}