zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.37k stars 1.16k forks source link

Add actual tutorial #3315

Open techtonik opened 1 month ago

techtonik commented 1 month ago

I knew micro for ages, but had to spend some time to discover how to do basic things like working with multiple files.

I think these notes belongs to official tutorial to help others discover micro and save that time. I tried to cut the amount of text to read, because people skim, don't read, but I am not sure if it became better.

Neko-Box-Coder commented 1 month ago

I think adding an example on how to edit a file using micro is great, but using micro codebase itself as an example requires a bit of effort. (Needs git and also need to clone it, not everyone is a developer)

Not to mention you can't do much with the cloned codebase after the example unless you are a developer or contributing to the codebase.

I personally think editing either bindings.json or settings.json is relatively straightforward and practical as a tutorial example. Or even extending it to init.lua would be quite nice as well.

And one minor note is that I think using ctrl-s is more familiar then F2 for saving a file? Or maybe list both of them?

techtonik commented 1 month ago

(Needs git and also need to clone it, not everyone is a developer)

I kind of agree with that, but let's also admit that we don't have the data. Maybe micro is a niche product only for developers and Linux savvy people, who know how to use wget or git clone to download stuff, or at least ask LLM about it. Everybody else is most likely using Notion or Google docs.

techtonik commented 1 month ago

And one minor note is that I think using ctrl-s is more familiar then F2 for saving a file? Or maybe list both of them?

Pressing Ctrl-s in Bash is a recipe to disaster, so it is a bad habit to have this motor memory in Linux terminal. I don't know why it is not possible in Linux to fix it.

techtonik commented 1 month ago

I personally think editing either bindings.json or settings.json is relatively straightforward and practical as a tutorial example. Or even extending it to init.lua would be quite nice as well.

Only vim need a need a tutorial to edit a single file. Other editors are quite intuitive with that. Tutorial should give some notable details about that specific editors, and common use cases. I found editing multiple files in vim and copy/pasting contents extremely hard to remember, so that's why I switched to micro few days ago.

techtonik commented 1 month ago

Actually it might be a good idea to provide short tutorials for different experience levels. Maybe also linking them to external sites.

But the greater problem for beginners that the tutorial is hard to find. On the web site it is hidden in About section.

Neko-Box-Coder commented 1 month ago

I personally think editing either bindings.json or settings.json is relatively straightforward and practical as a tutorial example. Or even extending it to init.lua would be quite nice as well.

Only vim need a need a tutorial to edit a single file. Other editors are quite intuitive with that. Tutorial should give some notable details about that specific editors, and common use cases. I found editing multiple files in vim and copy/pasting contents extremely hard to remember, so that's why I switched to micro few days ago.

I am not saying we can't have a tutorial that works with multiple files, we definitely can. In fact it is a good tutorial as well since we can introduce users to split/tab relatively easily.

What I was saying is that the tutorial should be using something the user already has. Using something the user needs to acquire just adds more effort to the tutorial and makes the user less likely to do it, which defeats the whole point of a practical tutorial.

Maybe we can copy and paste some of the keybindings or options from the help page to the user's keybindings / settings as an example of working with multiple files.

How does that sound? @techtonik

techtonik commented 1 month ago

@Neko-Box-Coder I don't know where these help files are.

$ tree ~/.config/micro 
/home/techtonik/.config/micro
├── backups
│   └── %tmp%micro%internal%config%plugin_manager.go
├── bindings.json
├── buffers
│   └── history
└── settings.json

3 directories, 4 files

I still think micro codebase is the best text corpus for experiment. Good introduction into Open Source. =)

Neko-Box-Coder commented 1 month ago

@techtonik No, I meant copying things from the help page to the user's settings.json or bindings.json as an example.

For example, we can say something like we want to set the brace highlighting style from underline to highlight when our cursor is on it but we don't remember what the exact name is, and we have no internet so we can't search it on micro's page.

So we open up our settings.json, then the options help page with ctrl-e, then type help options. Which is just a read-only buffer.

Find brace using ctrl-f and go to the next occurrences until we find matchbracestyle, copy it and the option highlight to settings.json on another split that we opened previously, ctrl-v to paste it to the place you like.

This is just an example on what we can do a tutorial on obviously.