Friday, February 14, 2014

Opening Terminal Commands in Editor

When editing a command in Terminal, you can type Control-X, Control-E to open it in your text editor of choice (via Wesley Darlington). When you save your changes and close the document, the command is executed.

I have my editor set to BBEdit via this line in ~/.bash_profile:

export EDITOR="bbedit -w"

5 Comments RSS · Twitter

I think this is more a bash feature than a Terminal feature. For example, the fish shell doesn't (yet) support this behavior. Thanks for pointing out `bbedit -w` though; not knowing about that option has kept me from using it as my `$EDITOR` before.

@bosmacs Yes, it’s a Bash feature. These days Bash is the default OS X shell.

Ctrl-X, Ctrl-E? Hm...

Open Keyboard Maestro, new Macro, available in Terminal, Triggered by ⌘E, Simulate Keystroke ^X, Simulate Keystroke ^E.

Awesome! :-)

@Lukas But “Use Selection for Find”… :-)

I'm sure it mourns the loss of its keyboard command :-)

Leave a Comment