Last active
April 18, 2021 09:42
-
-
Save OliverBalfour/afe51865bd07ac79e1fb391444ab7a8a to your computer and use it in GitHub Desktop.
default.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# espanso configuration file | |
# This is the default configuration file, change it as you like it | |
# You can refer to the official documentation: | |
# https://espanso.org/docs/ | |
# Matches are the substitution rules, when you type the "trigger" string | |
# it gets replaced by the "replace" string. | |
matches: | |
# Simple text replacement | |
- trigger: ":espanso" | |
replace: "Hi there!" | |
# Dates | |
- trigger: ":date" | |
replace: "{{mydate}}" | |
vars: | |
- name: mydate | |
type: date | |
params: | |
format: "%Y-%m-%d" | |
- trigger: ":fdate" | |
replace: "{{fulldate}}" | |
vars: | |
- name: fulldate | |
type: date | |
params: | |
format: "%A %-d %B %Y" | |
- trigger: ":time" | |
replace: "{{time}}" | |
vars: | |
- name: time | |
type: date | |
params: | |
format: "%H:%M" | |
# Obsidian daily note prefix | |
- trigger: ":daily" | |
replace: "#daily {{fulldate}}\n\nPrevious: [[{{mydate}}]]" | |
vars: | |
- name: fulldate | |
type: date | |
params: | |
format: "%A %-d %B %Y" | |
- name: mydate | |
type: date | |
params: | |
format: "%Y-%m-%d" | |
# Obsidian | |
- trigger: ":pagebreak" | |
replace: "<div style='page-break-after: always;'></div>" | |
# Shell commands | |
- trigger: ":shell" | |
replace: "{{output}}" | |
vars: | |
- name: output | |
type: shell | |
params: | |
cmd: "echo Hello from your shell" | |
# LaTeX | |
- trigger: ":math" | |
replace: "$$$|$$$" | |
- trigger: ":frac" | |
replace: "\\frac{$|$}{}" | |
- trigger: ":partial" | |
replace: "\\frac{\\partial}{\\partial $|$}" | |
- trigger: ":limz" | |
replace: "\\lim_{x\\rightarrow 0} $|$" | |
- trigger: ":liminf" | |
replace: "\\lim_{x\\rightarrow \\infty} $|$" | |
- trigger: ":defint" | |
replace: "\\int_a^b $|$ dx" | |
- trigger: ":int" | |
replace: "\\int $|$ dx" | |
- trigger: ":rvec2" | |
replace: "\\begin{bmatrix} x_1 & x_2 \\end{bmatrix}" | |
- trigger: ":cvec2" | |
replace: "\\begin{bmatrix} x_1 \\\\\ x_2 \\end{bmatrix}" | |
- trigger: ":rvec3" | |
replace: "\\begin{bmatrix} x_1 & x_2 & x_3 \\end{bmatrix}" | |
- trigger: ":cvec3" | |
replace: "\\begin{bmatrix} x_1 \\\\ x_2 \\\\ x_3 \\end{bmatrix}" | |
- trigger: ":mat2x2" | |
replace: "\\begin{bmatrix} x_{11} & x_{12} \\\\ x_{21} & x_{22} \\end{bmatrix}" | |
- trigger: ":mat3x2" | |
replace: "\\begin{bmatrix} x_{11} & x_{12} \\\\ x_{21} & x_{22} \\\\ x_{31} & x_{32} \\end{bmatrix}" | |
- trigger: ":mat2x3" | |
replace: "\\begin{bmatrix} x_{11} & x_{12} & x_{13} \\\\ x_{21} & x_{22} & x_{23} \\end{bmatrix}" | |
- trigger: ":mat3x3" | |
replace: "\\begin{bmatrix} x_{11} & x_{12} & x_{13} \\\\ x_{21} & x_{22} & x_{23} \\\\ x_{31} & x_{32} & x_{33} \\end{bmatrix}" | |
- trigger: ":matmxn" | |
replace: "\\begin{bmatrix} x_{11} & x_{12} & \\cdots & x_{1n} \\\\ x_{21} & x_{22} & \\cdots & x_{2n} \\\\ \\vdots & \\vdots & \\ddots & \\vdots \\\\ x_{m1} & x_{m2} & \\cdots & x_{mn} \\end{bmatrix}" | |
- trigger: ":matnxn" | |
replace: "\\begin{bmatrix} x_{11} & x_{12} & \\cdots & x_{1n} \\\\ x_{21} & x_{22} & \\cdots & x_{2n} \\\\ \\vdots & \\vdots & \\ddots & \\vdots \\\\ x_{n1} & x_{n2} & \\cdots & x_{nn} \\end{bmatrix}" | |
- trigger: ":vec" | |
replace: "\\vec{$|$}" | |
- trigger: ":R" | |
replace: "\\mathbb{R}" | |
- trigger: ":Z" | |
replace: "\\mathbb{Z}" | |
- trigger: ":N" | |
replace: "\\mathbb{N}" | |
- trigger: ":Q" | |
replace: "\\mathbb{Q}" | |
- trigger: ":nnR" | |
replace: "\\mathbb{R}^{n\\times n}" | |
- trigger: ":mnR" | |
replace: "\\mathbb{R}^{m\\times n}" | |
- trigger: ":text" | |
replace: "\\text{$|$}" | |
- trigger: ":sum" | |
replace: "\\sum_{i=0}^n" | |
- trigger: ":env" | |
replace: "\\begin{{{clipboard}}}\n $|$\n\\end{{{clipboard}}}" | |
vars: | |
- name: "clipboard" | |
type: "clipboard" | |
- trigger: ":eq" | |
replace: "\\begin{equation}\n $|$\n\\end{equation}" | |
- trigger: ":paren" | |
replace: "\\left( $|$ \\right)" | |
- trigger: ":bold" | |
replace: "\\mathbf{$|$}" | |
- trigger: ":inv" | |
replace: "^{-1}" | |
- trigger: ":sup" | |
replace: "^{$|$}" | |
- trigger: ":sub" | |
replace: "_{$|$}" | |
- trigger: ":lt" | |
replace: "LaTeX" | |
- trigger: ":fun" | |
replace: "f : \\mathbb{R} \\mapsto \\mathbb{R}" | |
- trigger: ":del" | |
replace: "\\Delta " | |
- trigger: ":M" | |
replace: "$$|$$" | |
- trigger: ":prop" | |
replace: "\\propto " | |
- trigger: ":rho" | |
replace: "\\rho " | |
# Images | |
- trigger: ":pfp" | |
image_path: "/home/oliver/Pictures/profile.png" | |
# Utils | |
- trigger: ":localip" | |
# alias localip="ip route get 8.8.8.8 | awk '{print $(NF-2); exit}'" | |
# if the alias doesn't work, try $NF instead of $(NF-2) | |
replace: "{{output}}" | |
vars: | |
- name: output | |
type: shell | |
params: | |
cmd: "ip route get 8.8.8.8 | awk '{print $(NF-2); exit}'" | |
- trigger: ":publicip" | |
replace: "{{output}}" | |
vars: | |
- name: output | |
type: shell | |
params: | |
cmd: "curl 'https://api.ipify.org'" | |
- trigger: ":espconfig" | |
replace: "espanso edit default" | |
- trigger: ":mdash" | |
replace: "—" | |
- trigger: ":bullet" | |
replace: "•" | |
- trigger: ":check" | |
replace: "✓" | |
# Emoji | |
- trigger: ":heart" | |
replace: "❤️" | |
- trigger: ":joy" | |
replace: "😂" | |
- trigger: ":thumb" | |
replace: "👍" | |
- trigger: ":P" | |
replace: "😛" | |
- trigger: ":)" | |
replace: "😃" | |
# Progress bar | |
- trigger: ":pb" | |
form: "" | |
form_fields: | |
value: | |
default: 0 | |
scale: | |
default: 100 | |
title: | |
default: null | |
width: | |
default: 250 | |
suffix: | |
default: "%" | |
# Python | |
- trigger: ":tf" | |
replace: "import tensorflow as tf\n" | |
- trigger: ":plt" | |
replace: "import matplotlib.pyplot as plt\n" | |
- trigger: ":keras" | |
replace: "from tensorflow import keras\nfrom tensorflow.keras import layers\n" | |
- trigger: ":np" | |
replace: "import numpy as np\n" | |
- trigger: ":pd" | |
replace: "import pandas as pd\n" | |
- trigger: ":pyread" | |
replace: "with open(\"$|$\", \"r\") as f:" | |
- trigger: ":pywrite" | |
replace: "with open(\"$|$\", \"rw\") as f:" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment