logoalt Hacker News

eddygyesterday at 8:00 PM4 repliesview on HN

^X^E in bash takes your current prompt and moves it to your $EDITOR.

for zsh:

  autoload edit-command-line
  zle -N edit-command-line
  bindkey '^X^E' edit-command-line

Replies

amdiviatoday at 12:02 PM

Or v for those using bash's vi mode

seanhuntertoday at 11:22 AM

or just type "fc" to edit the previous command.

Machayesterday at 10:41 PM

Other shortcuts to edit prompt in editor:

Alt-e for fish

Ctrl-g for Claude code

KingMobtoday at 5:18 AM

Right, but if all terminals behaved like modern pieces of software, we would take functionality like Warp's as given, instead of suggesting workarounds.

What you describe sorta works, but you lose things like file/dir-based autocomplete, since your editor doesn't know about your shell session.