Email or username:

Password:

Forgot your password?
Top-level
peter

@b0rk i always liked how postgres' psql lets you switch into vim mode with \e or \edit and wondered if there was an equivalent in shells

7 comments
A Lloyd Flanagan

@schpet set -o vi, if I remember correctly

peter

@alloydflanagan i think that switches your shell permanently into vim keybindings (right?) – i'm more looking for something that opens up $EDITOR to edit the command

A Lloyd Flanagan

@schpet oh! Hmmmm… sounds like you’d have to replace or hook into readline. Sorry no idea.

peter

@alloydflanagan huh – so after looking into a bit i found out that bash supports this via ctrl-x-e:

**edit-and-execute-command (C-x C-e)**

gnu.org/software/bash/manual/h

this... is something i would have liked to have known a decade ago. now i need to find the equivalent in fish

peter

@alloydflanagan OK, i think it's `Alt`+`E` but for whatever reason alt is giving me grief on a mac

fishshell.com/docs/current/int

> Alt+E edit the current command line in an external editor. The editor is chosen from the first available of the `$VISUAL` or `$EDITOR` variables.

A Lloyd Flanagan

@schpet I didn’t know that one either. They didn’t borrow that one from Emacs. There, it runs the current LISP expression.

Go Up