Skip to content

Latest commit

 

History

History
21 lines (19 loc) · 802 Bytes

README.md

File metadata and controls

21 lines (19 loc) · 802 Bytes

TD

A native terminal dictionary, with a few lines in bash and a collection of txt dictionaries.

Usage

  1. Download the txt dictionaries to dictPath
  2. Put following lines to your zshrc or bashrc
unalias d
d() {
  blue=`echo -e "\e[1m\e[34m"` # specify format for dictionary name and word being looked in urxvt.
  norm=`echo -e "\e[0m"` # normal format in urxvt.
  dictPath=~/Dropbox/dictionaries/ # change this to your dictionaries' path
  pcregrep -M  "^$1\n.*" ${dictPath}*.txt \
    | sed "s/\/home.*dictionaries\/\(.*\)\.txt\(.*\)/${blue}\1\2${norm}/" \
    | perl -pe 's/(interj|n|v|adj|adv|conj|pron|prep)(?=\.)/\n\1/g'
}

Demo

vicon

Chinese