diff options
-rwxr-xr-x | bin/extra/wd | 24 | ||||
-rwxr-xr-x | checkpoint.sh | 2 | ||||
-rw-r--r-- | config/essentials/vis/visrc.lua | 1 |
3 files changed, 13 insertions, 14 deletions
diff --git a/bin/extra/wd b/bin/extra/wd index 73bbaf7..1b56aa6 100755 --- a/bin/extra/wd +++ b/bin/extra/wd @@ -1,16 +1,14 @@ #!/bin/sh +[ "$1" ] || exit 1 +dict "$1" | + sed -e '/^ /!d;s/^ //' | + sed -e '/^$/d;s/^[^ ].*$/\o033[1;4;34m&\o033[0m/' | -### Word Definition -# Based on https://askubuntu.com/questions/191125/is-there-an-offline-command-line-dictionary -# -### Installation -# > sudo mkdir -p /usr/share/stardict/dic/ -## Get the dictionaries -# > wget https://web.archive.org/web/20140428003644/http://abloz.com/huzheng/stardict-dic/dict.org/stardict-dictd_www.dict.org_gcide-2.4.2.tar.bz2 -# > wget https://web.archive.org/web/20140428004049/http://abloz.com/huzheng/stardict-dic/misc/stardict-xfardic-gnu-linux-2.4.2.tar.bz2 -## Other dictionaries I'd like to get -# https://foldoc.org/scalar + # foldoc + sed -e '/^ /s/</\o033[2m/g' -e '/^ /s/>/\o033[0m/g' | -sdcv -nj "$1" | - jq -r '.[].definition' | - sed -e '/^$/d;s/^[^ ].*$/\o033[1;4;38m&\o033[0m/' + # webster + sed -r -e 's/ \\\<\w+\>\\//g' -e '/^ *\[[^]]*Webster[^]]*\]/d' | + # replace {} by blue underline + sed -e '/^ /s/{/\o033[4m/g' -e '/^ /s/}/\o033[0m/g' | + tr -d '{}' # remove {} in word definition diff --git a/checkpoint.sh b/checkpoint.sh index 62c138c..e2ee407 100755 --- a/checkpoint.sh +++ b/checkpoint.sh @@ -1,5 +1,5 @@ #!/bin/sh -git commit -m 'checkpoint' +git commit -a -m 'checkpoint' keyadd db git push diff --git a/config/essentials/vis/visrc.lua b/config/essentials/vis/visrc.lua index 9bc18f9..04d4792 100644 --- a/config/essentials/vis/visrc.lua +++ b/config/essentials/vis/visrc.lua @@ -123,6 +123,7 @@ vis.events.subscribe(vis.events.INIT, function() end) vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- luacheck: no unused args + vis:info(win.file.name) win.options.relativenumbers = true if win.syntax == "bash" then |