Skip to content

Michael1015198808/zsh-vocab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zsh-vocab

Have you ever think of a software or a plugin that allows you to recite words when you're working in a terminal?

zsh-vocab allows you to do so when using zsh!(Or other powerful shell)

Version

1.0.0

Demo

screenshots

Usage

You can execute this program manually by

python3 vocab.py [args]

For helpful information:

python3 vocab.py -h

Preparation

To allow it run automatically, there're many ways.

  • Add a bash function into ~/.bashrc
function vocab {
    python3 ~/vocabulary/main.py $*
}
  • Add the following script to /bin, named as /bin/vocab

    You can put this script otherwhere, add manually add it to your PATH.

python3 ~/vocabulary/main.py $*

Automation

If you've done things in the section above, you just need to add the following to your zsh(Or other shell)'s theme

$(vocab)

Otherwise, you need to add

$(python3 ~/vocabulary/main.py)

That's my zsh's theme

PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;30m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - <$(git_prompt_info)> - %{\e[0;34m%}%B[%b%{\e[0;33m%}'%D{"%a %b %d, %H:%M"}%b$'%{\e[0;34m%}%B]%b%{\e[0m%}$(if [ $temp ]; then echo ;echo -ne "\033[0;34m%B│"; echo temp:$temp; fi)
%{\e[0;34m%}%B│$(vocab)
%{\e[0;34m%}%B└─%b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%b%{\e[0;34m%}%B] %{\e[1;35m%}$%{\e[0m%}%b'

Download word lists

Create a json file according to the format shown in python3 main.py --help, and then copy to ~/.vocab/data.json.

If you would like a commonly used list(CET 4/6, TOEFL, IELTS) and you have a word list of some other format, you can create a issue and I'll add the word list to a branch.

Environment

Language: Python3

System: debian9

This repo only supports Python3 now. It may supports Python2 in the future. Since Python 2 has reached its end-of-life, this repo will not support Python 2.

This repo supports debian 9(My PC), other Linux systems haven't be tested. Other systems like Windows or Mac-os haven't be tested either.

Other things

For any advice or bugs founded, just create a new issue or a pull request.

About

A tool for reciting words in zsh

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages