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

Add a Tip for command line navigation as part of "Naviational Shortcuts" in episode 2 #334

Open
jlchang opened this issue Mar 28, 2023 · 3 comments

Comments

@jlchang
Copy link

jlchang commented Mar 28, 2023

Proposing in an issue in case the maintainers feel episode 2 has too many concepts to add another... If there's room, I'd suggest adding a Tip section to Naviational Shortcuts that, similar to the Ctrl+L shortcut for clear introduced in episode 1, shows how to quickly move to the beginning or end of a line in the terminal.

Here's what the tip might look like:

Tip

Try hot-key combinations to navigate the command line itself. This allows editing of previously typed commands or effective re-use of your command history. (In most systems, pressing the up arrow will recall the last command you ran in your terminal)
The hot-key combination to move your cursor to the beginning of the line is Ctrl+A, while Ctrl+E will take you to the end of the line.
{: .callout}

Other tips in this vein include Ctrl+U and Ctrl+K for "delete everything before the cursor" or "after the cursor", respectively.

Happy to contribute as a PR if the maintainers feel it is appropriate to add. In my experience, most people appreciate any hints that will cut down on the number of keystrokes needed to complete a task!

@p-j-smith
Copy link
Contributor

Hi @jlchang thanks for the suggestions! I think these are useful tips to make users aware of. However, the tip about using the up arrow is already mentioned in episode 3, and we should probably avoid repeating too much information.

Perhaps the tip about Ctrl+A and Ctrl+E could be added after the section on tab completion in episode 1? Something like:

Tip

You may have typed a long command that you would like to edit before executing. Hot-key combinations can be useful for quickly moving your cursor to the beginning or end of a command for editing.

The hot-key combination Ctrl+A will move your cursor to the beginning of the line is, while Ctrl+E will take you to the end of the line.
{: .callout}

Happy to contribute as a PR if the maintainers feel it is appropriate to add. In my experience, most people appreciate any hints that will cut down on the number of keystrokes needed to complete a task!

That would be excellent!

@jlchang
Copy link
Author

jlchang commented Sep 28, 2023

Thanks for the feedback, @p-j-smith . I'll submit a PR with a new tip for Ctrl+A and Ctrl+E. Thanks for the example. I see how providing some context (with minimal jargon) for the utility of the shortcut will help a new user understand why it might be useful. Do you think it would be useful to include Ctrl+U and Ctrl+K or too much?

@p-j-smith
Copy link
Contributor

I'll submit a PR with a new tip for Ctrl+A and Ctrl+E.

great, thank you

Do you think it would be useful to include Ctrl+U and Ctrl+K or too much?

I think they're useful commands to know but it may be a bit too much information for a short tip?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants