lemnos / tt

A terminal based typing test.
MIT License
714 stars 48 forks source link

adding a new test in a code style typing #31

Closed falcucci closed 1 year ago

falcucci commented 1 year ago

hey @lemnos thanks for this typing on terminal idea.

I was thinking about using this cli to practice more in a real case scenario which we developers are more used to do in a daily basis.

It would be fantastic to maybe bring the possibility of replicate code "quotes" as a test to practice our typing speed.

As an example I usually uses typing.io to practice but due to the fact we should always go and open the browser, isnt so simple as do it at our own terminal.

this one is a new test in a code style typing to the man.md file. the new test is added to the section on paths and is written in the bash language.

unfortunately there is some bugs to interact with words as we complete typing.

please try it yourself with the following example.

curl -LsS https://raw.githubusercontent.com/lemnos/tt/master/src/tt.go |  head -n 20 | tt -noskip -raw
Screenshot 2023-01-15 at 22 26 49

let me know if it makes senses to proceed with this feature at this repo our I should create my own version of it.

see yo

lemnos commented 1 year ago

Thanks. Sorry this took so long to merge. I have squashed it into a single commit and included it in the latest commit (in the future please condense your PRs into as few commits as possible, it helps keep the history clean).

I was thinking about using this cli to practice more in a real case scenario which we developers are more used to do in a daily basis. It would be fantastic to maybe bring the possibility of replicate code "quotes" as a test to practice our typing speed.

I've contemplated adding some kind of code mode before, but never got around to it. There are a few additional considerations given the current design, like what a 'word' should constitute, or how to treat tab width. There is also the matter of which code samples to ship by default.

unfortunately there is some bugs to interact with words as we complete typing.

Yes, -raw is mainly intended for user supplied plain text, not code, so it treats words identically to the generated input. Fixing this without breaking backward compatibility or interoperation with the other flags is non trivial. I will probably do a proper major release at some point which supports this and cuts back on much of the fat of the original design.