-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add actual tutorial #3315
base: master
Are you sure you want to change the base?
Add actual tutorial #3315
Conversation
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 And one minor note is that I think using |
I kind of agree with that, but let's also admit that we don't have the data. Maybe |
Pressing |
Only |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a positive change overall. I'm not sure if the chosen example of editing workflow is ideal but having an example definitely feels like a good idea.
``` | ||
> open internal/config/plugin_manager.go | ||
``` | ||
Then from the command prompt (`Ctrl-e`) open a second file in a vertical split | ||
``` | ||
> vsplit internal/config/plugin.go | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest of the file has empty lines on either side of code block, I'd add them here too for consistency and readability.
Have you considered using (or at least mentioning) tab
instead of vsplit
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. For me tab
is a key. =)
In i3
I don't need tabs. The edit workflow when you can see two or more files in one window seems more useful to me. Maybe the real reason why I decided to use micro
is because copying text between vim
instances running in different tabs didn't work for me, or the contents was lost when vim
exits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the opposite for me – I mainly use tabs because I keep my terminal window small and there's not really enough space for two buffers to fit comfortably. From my perspective tabs are the more basic form of operation (if you open multiple files at once the default behavior is to open them in tabs) and splits are slightly more advanced feature that users can learn about on their own. But I guess it ultimately doesn't really matter which one the tutorial uses.
To preview the changes, run `git diff` by pressing `Ctrl-b` ("shell mode") | ||
and entering the command. You will see changes only to the second file | ||
`plugin.go`, because the first file is not saved yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git
is rarely installed by default so it might not be the best example to use for the command mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can rename the tutorial "Copying micro
code with micro
", to make it clear that it is for developers. Trying to squeeze everything in one tutorial is impossible anyways, and I don't know the target auditory that works with micro
without git
.
If there is another way to see changes since the file was opened, let's list them here.
runtime/help/tutorial.md
Outdated
that is created the first time you run micro. You can edit the `settings.json` | ||
file directly, or you can use `> set option value` command from micro, which | ||
modifies `settings.json` file too, so that the setting will stick even after | ||
you close micro. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this sentence is too long which makes it harder to comprehend compared to the original phrasing. It's also missing the note about the modification taking effect immediately (which importantly does not happen when modifying the settings file directly).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's was unclear from the previous doc. Let me try to rephrase that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try the next text. Should be better now.
runtime/help/tutorial.md
Outdated
You can also set options temporary for the local buffer without saving then. | ||
For example, if you have two splits open, and you type `> setlocal tabsize 2`, | ||
the tabsize will only be 2 in the current buffer, and micro will not save | ||
this local change to the `settings.json` file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would avoid the word "local" because users might assume it means local as the opposite of remote (many other modern text editors have remote editing features).
You can also set options temporary for the local buffer without saving then. | |
For example, if you have two splits open, and you type `> setlocal tabsize 2`, | |
the tabsize will only be 2 in the current buffer, and micro will not save | |
this local change to the `settings.json` file. | |
You can set options temporarily for the currently open buffer without saving them. | |
For example, if you have two splits open, and you type `> setlocal tabsize 2`, | |
the tabsize will only be 2 in the current buffer, and micro will not save | |
this change to the `settings.json` file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also don't like local
, but the command is called setlocal
and I feel it needs explanation. Otherwise it is hard to understand and remember.
The best way would be set
(only for current file) and setconfig
(save option to configuration), and maybe setfileconfig
(save to configuration for the current file extension).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explained with "local is not global", because the "local buffer" sounds like too much internal details.
I am not saying we can't have a tutorial that works with multiple files, we definitely can. What I was saying is that the tutorial should be using something the user already has. 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 |
@Neko-Box-Coder I don't know where these $ 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 |
@techtonik 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 Find This is just an example on what we can do a tutorial on obviously. |
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.