mirror of
https://github.com/jbranchaud/til
synced 2026-01-08 17:48:01 +00:00
Add Open The Current Command In An Editor as a unix til
This commit is contained in:
@@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really
|
|||||||
warrant a full blog post. These are mostly things I learn by pairing with
|
warrant a full blog post. These are mostly things I learn by pairing with
|
||||||
smart people at [Hashrocket](http://hashrocket.com/).
|
smart people at [Hashrocket](http://hashrocket.com/).
|
||||||
|
|
||||||
_434 TILs and counting..._
|
_435 TILs and counting..._
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -393,6 +393,7 @@ _434 TILs and counting..._
|
|||||||
- [Less With Style](unix/less-with-style.md)
|
- [Less With Style](unix/less-with-style.md)
|
||||||
- [List All Users](unix/list-all-users.md)
|
- [List All Users](unix/list-all-users.md)
|
||||||
- [Only Show The Matches](unix/only-show-the-matches.md)
|
- [Only Show The Matches](unix/only-show-the-matches.md)
|
||||||
|
- [Open The Current Command In An Editor](unix/open-the-current-command-in-an-editor.md)
|
||||||
- [Partial String Matching In Bash Scripts](unix/partial-string-matching-in-bash-scripts.md)
|
- [Partial String Matching In Bash Scripts](unix/partial-string-matching-in-bash-scripts.md)
|
||||||
- [PID Of The Current Shell](unix/pid-of-the-current-shell.md)
|
- [PID Of The Current Shell](unix/pid-of-the-current-shell.md)
|
||||||
- [Repeat Yourself](unix/repeat-yourself.md)
|
- [Repeat Yourself](unix/repeat-yourself.md)
|
||||||
|
|||||||
22
unix/open-the-current-command-in-an-editor.md
Normal file
22
unix/open-the-current-command-in-an-editor.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# Open The Current Command In An Editor
|
||||||
|
|
||||||
|
If you are working with a complicated command in the terminal trying to get
|
||||||
|
the arguments just right. Such as this `curl`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl https://api.stripe.com/v1/customers \
|
||||||
|
-u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \
|
||||||
|
-d description="Customer for test@example.com" \
|
||||||
|
-d source=tok_189fCz2eZvKYlo2CsGERUNIW
|
||||||
|
```
|
||||||
|
|
||||||
|
It can be tedious to move to and modify various parts of the command.
|
||||||
|
However, by hitting `Ctrl-x Ctrl-e`, the contents of the command buffer
|
||||||
|
will be opened into your default editor (i.e. `$EDITOR`). This will make
|
||||||
|
editing the command a bit easier. Saving and quitting the editor will put
|
||||||
|
the updated command in the command buffer, ready to run.
|
||||||
|
|
||||||
|
Hit `Ctrl-x Ctrl-e` with an empty command buffer if you want to start
|
||||||
|
crafting a command from scratch or if you are pasting one in from somewhere.
|
||||||
|
|
||||||
|
h/t Josh Davey
|
||||||
Reference in New Issue
Block a user