Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create something akin to vimtutor for Helix #506

Open
2 of 9 tasks
Omnikar opened this issue Jul 25, 2021 · 21 comments · Fixed by #537
Open
2 of 9 tasks

Create something akin to vimtutor for Helix #506

Omnikar opened this issue Jul 25, 2021 · 21 comments · Fixed by #537
Labels
A-documentation Area: Documentation improvements C-enhancement Category: Improvements E-help-wanted Call for participation: Extra attention is needed

Comments

@Omnikar
Copy link
Contributor

Omnikar commented Jul 25, 2021

This would introduce the user to modal editing, and to Helix's commands and its multiple selections. I think it could be opened via something like hx --tutor, or opened from within the editor with :tutor.

This is currently WIP. Current progress can be found in runtime/tutor.txt.

PRs:

Todos:

@Omnikar Omnikar added the C-enhancement Category: Improvements label Jul 25, 2021
@pickfire pickfire added the E-help-wanted Call for participation: Extra attention is needed label Jul 26, 2021
@python128
Copy link
Contributor

python128 commented Jul 26, 2021

VIm tutor is basically a text file which contains explanations of keys, and some examples to work on, right?

I had a look at this site for thus info, because I never used vim: here

If so, can I have a go at this?

@Omnikar
Copy link
Contributor Author

Omnikar commented Jul 26, 2021

Yes, vimtutor is just a text file separated into lessons which interactively introduce the keys and concepts, and each of which is sized to fit on an 80x24 terminal screen.

@aeosynth
Copy link

Kakoune has something similar: https://github.com/mawww/kakoune/blob/master/contrib/TRAMPOLINE

@Omnikar
Copy link
Contributor Author

Omnikar commented Jul 28, 2021

Kakoune has something similar: https://github.com/mawww/kakoune/blob/master/contrib/TRAMPOLINE

I know this doesn't have to do with the tutorial itself, but what if we were to copy that title page idea?

 _   _                 __    __
| | | |         _      \ \  / /
| |_| |   ___  | | (_)  \ \/ /
|  _  |  / _ \ | |  _    )  (
| | | | |  __/ | | | |  / /\ \
|_| |_|  \___| |_| |_| /_/  \_\

@python128
Copy link
Contributor

Kakoune has something similar: https://github.com/mawww/kakoune/blob/master/contrib/TRAMPOLINE

I know this doesn't have to do with the tutorial itself, but what if we were to copy that title page idea?

 _   _                 __    __
| | | |         _      \ \  / /
| |_| |   ___  | | (_)  \ \/ /
|  _  |  / _ \ | |  _    )  (
| | | | |  __/ | | | |  / /\ \
|_| |_|  \___| |_| |_| /_/  \_\

Actually a good idea, but I would suggest using some other format, rather than the exact one used by Kakoune...

@Omnikar
Copy link
Contributor Author

Omnikar commented Jul 28, 2021

Kakoune has something similar: https://github.com/mawww/kakoune/blob/master/contrib/TRAMPOLINE

I don't think I like the format of this in comparison to Vimtutor. The latter emphasizes that the user should learn by doing, rather than trying to memorize everything, and provides tasks for the user to complete using what is taught in each lesson. Whereas Kakoune's seems to just list the keys and describe what they do.

@python128
Copy link
Contributor

python128 commented Jul 28, 2021

How about I do it like vimtutor, but some ideas used by Kakoune's list. Eg:
I can make it interactive like vimtutor, but make the keys like kakoune. i.e. :

       .---,
       | ↑ |        Movement in a buffer (the representation of the contents
   .---'---'---,    of a file opened by Kakoune) can be achieved using the arrow
   | ← | ↓ | → |    keys, which will move the cursor up one column/row into
   `---'---'---`    a given direction.
Try moving around the file!

@Omnikar
Copy link
Contributor Author

Omnikar commented Jul 28, 2021

As long as it maintains Vimtutor's premise of learning by doing by giving the user small tasks to perform using the skills they learn. Also, you might want to open a draft PR so that you can receive feedback as you work on this.

@olanod
Copy link

olanod commented Jul 29, 2021

As someone who finds the project quite neat but a bit clueless about its full potential and advance usage I'll just stick around to watch how tutorials and documentation get better 👀

@Omnikar
Copy link
Contributor Author

Omnikar commented Aug 13, 2021

Ok, a partial tutorial has been added by #537. I'll leave this open until the tutorial is completed.

@A-Walrus
Copy link
Contributor

Should there be some kind of explanation on using LSP and TS features within tutor?

TS features should be fairly straightforward, show some example code in whatever language, and ask them to navigate with go to next function and things like that.

For the language server it's a bit tricky since we can't really rely on the user having any specific language server installed can we?
I would want an explanation of capabilities such as go to definition/implementation/etc..., show documentation, code actions.

@the-mikedavis
Copy link
Member

Both are difficult to add to the current tutor because they need the document to be a language with tree-sitter and language-server support and currently it's text, plus it would need you to install the language server for that language. That may be better left off as a separate git project similar to https://github.com/rust-lang/rustlings

@CobaltCause
Copy link
Contributor

It'd be cool if the tutor file was somehow templated from the configured keybinds so it would always display the correct instructions even if the user had rebound the key. I imagine this would be pretty difficult to implement though.

@correabuscar
Copy link

in 3.5 SELECT / EXTEND MODE, if I mouse click on B of FOO BAR then press b to get to F, because FOO is now selected, then when I do the suggested v2w it selects only BAR. Maybe mentioning the solution for to how to "fix" this possibility would be great to see there.

I might be the only one, but this kind of thing stops me in my tracks and I stop following the tutor and do something else, unrelated, instead. ie. it's easy to give up on helix when tiny things like this happen, and just fall back to nvim.

@DanInSpace104
Copy link

I don't know if it is problem with tutor, or with default colorscheme, but when i do 10.1 CYCLING AND REMOVING SELECTIONS after 4-th step i can't see any difference between selections at all
No matter how many times i press ( or ) or Alt-) or Alt-( it looks the same:
image

@the-mikedavis
Copy link
Member

That's #3842.

@divarvel
Copy link
Contributor

divarvel commented Jan 18, 2023

We might want to remove the match mode from the todo-list, since it depends on a tree-sitter grammar for most operations.

As such,

  • mm does not work
  • mam / mim work with brackets, braces, parens, but not double quotes
  • ms works
  • md / mr don't work

I was a bit surprised that mam/mim work for some pairs, but not quotes, and that mm does not work at all, even for pairs supported by mam / mim.

That makes writing a chapter on the match minor mode a bit tricky. I also tried this in a markdown file with a rust block, hoping that the language injection feature would allow using matching mode movements inside it, but it seems it's only used for highlighting (edit: with #5176, making the tutor a markdown file would let us use other languages to demonstrate tree-sitter features)

@goyalyashpal
Copy link
Contributor

if the tutor file was somehow templated from the configured keybinds
- @ CobaltCause at #506 (comment)

i was thinking exact same thing :)

@jokeyrhyme
Copy link

Perhaps the TS and LSP lessons could be implemented in multiple languages, and :tutor could either prompt the user to pick, or could auto-select one based on the best available combination of lesson + grammar + server?

There's probably only a handful of languages needed to significantly cover the user base

@jokeyrhyme
Copy link

We could also wait for the plugin system, and either ship the TS and LSP for the plugin system's language, or privilege that language by having :tutor show you how to install any missing pieces?

@ghost
Copy link

ghost commented Oct 2, 2024

I'm doing the tutor. I know I'm nitpicking... sorry! D:
It seems written biased to US Qwerty keyboard layout.
On line 498 it says Note: To search backwards, type ? (Shift-/).
I'm on a Nordic Qwerty International keyboard layout. It looks and works completely different.
(? on my keyboard is Shift and +, where + is next to 0)

Might want to remove such hints, as they would probably cause more confusion than anything for someone not well versed in different keyboard layouts.
Thank you!

See picture for comparison
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation Area: Documentation improvements C-enhancement Category: Improvements E-help-wanted Call for participation: Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.