file gen
:
#!/usr/bin/env -S awk -f
#
# Usage: ./gen misspells-fr.csv > user/misspells-fr.yml
BEGIN {
FS=","
print "parent: default"
print "matches: "
}
{
print ""
print " - trigger: \""$1"\""
print " replace: \""$2"\""
print " propagate_case: true"
print " word: true"
}
file gen-all
:
#!/bin/sh
espanso stop
set -x
for file in *.csv; do
./gen $file > user/$(basename -s .csv $file).yml
done
espanso start
I'm always addind more expansions, and theses scripts really saved me a lot of typing:
input
$ wc -l *.csv 55 misspells-en.csv 42 misspells-fr.csv 97 total
output
$ wc -l user/* 277 user/misspells-en.yml 212 user/misspells-fr.yml 489 total
yes, I make a lot of typos xD