Writing in the front

I’ve been using VS Code terminals for quite some time now, and today I found two tips to record my excitement. So what problems do these techniques solve?

  1. Some words in the command are incorrectly typed. When you want to change a word, you have to delete or move it from back to front letter by letter, which is clumsy and unfriendly.
  2. Command whole wrong, want to delete all, but want to delete a letter by letter, often very speechless…

Time is precious, too.

Two techniques

If you’re struggling with these questions, read on. (The Mac OS is used as an example.)

1. Modify some commands

If you want to add sudo to the front of the command, you can do so

Option + Mouse clickCopy the code

The premise is that the terminal has captured the focus, and then the cursor has moved near the specified position.

It’s much more efficient than moving one letter at a time!

2. Delete the entire command

When you go from pasting a command to a terminal, for all sorts of possible reasons, you suddenly don’t want to execute it, you can

Command + Delete keyCopy the code

The Corresponding Windows key is the Control + Delete key, which allows you to quickly delete the entire command.

Another technique, the up and down keys to view the history command, I think we all know, not so verbose.

conclusion

  • Option + Mouse click, quickly move the cursor, modify the command;
  • Command/Control + delete key to delete the entire command;
  • Click up or down to view the history command