Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"v" just opens your $EDITOR, btw, not necessarily vim-in-terminal.

It's basically the same as the bash built-in "fc" command, but operates on the current line instead of the last one.



Interestingly, the readline command "edit-and-execute-command" does what it says on the tin (by recourse to fc) even if you're in a context where the line wouldn't usually be executed. If you try prompting for filenames with the read builtin, and turn on readline (-e) to get completions, and hit v (or, in emacs mode, C-x C-e) to open your editor, when you leave your editor it will execute whatever you typed as a line of bash. Unexpected.


Ooh, thank you! That's exactly what I've been looking for.

Basically the only time I feel the need for vi editing powers in bash is when one (or more) long complicated commands need edited and this fills that gap nicely.

One of the Google results that most succinctly summed up what this command can do: http://htks.kylemilnes.com/2012/07/bash-fc-fix-command-cheat...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: